Skip to content

Conversation

rschamp
Copy link
Contributor

@rschamp rschamp commented Oct 24, 2016

This adds the whitespace rules @thisandagain pointed out in scratchfoundation/scratch-vm#298.

I missed a lot of whitespace-related rules because I mistook the "autofix" symbol on http://eslint.org/docs/rules/ for the "included in eslint/recommended" symbol. So I added the ones that make sense for us (we already adhere to them in scratch-vm).

One more worth pointing out is 'quote-props': [2, 'consistent-as-needed']: Object properties should not use quotes unless necessary, in which case all properties of the object should use quotes.

After I added and fixed this in scratch-vm, it pointed out I was too strict with the camelcase rule, so that now excludes object properties from needing to be camelcase (we use many underscores in object properties in scratch-vm).

Ray Schamp added 15 commits October 24, 2016 10:36
Automatically include Node globals when using the node config
Array brackets should not have spaces inside of them

BREAKING CHANGE: http://eslint.org/docs/rules/array-bracket-spacing ([2, 'never'])
Object properties should not use quotes unless necessary, in which case all properties of the object

should use quotes.

BREAKING CHANGE: http://eslint.org/docs/rules/quote-props ([2, 'consistent-as-needed'])
Because of the addition of quote-props, the linter picked up non-camelcase object props. Object

properties shouldn't be linted for camelcase.
Semicolons should have spaces after them, and not before them. Obviously.

BREAKING CHANGE: http://eslint.org/docs/rules/semi-spacing ([2])
Objects shouldn't have spaces after the opening curly or before the closing one.

BREAKING CHANGE: http://eslint.org/docs/rules/object-curly-spacing ([2])
There shouldn't be spaces in parens

BREAKING CHANGE: http://eslint.org/docs/rules/space-in-parens ([2])
There should be spaces around infix operators

BREAKING CHANGE: http://eslint.org/docs/rules/space-infix-ops ([2])
There should be spaces after word unary ops, but there shouldn't be spaces before nonword unary ops.

BREAKING CHANGE: http://eslint.org/docs/rules/space-unary-ops ([2])
Comments should have a space after the opening comment character

BREAKING CHANGE: http://eslint.org/docs/rules/spaced-comment ([2])
@rschamp rschamp self-assigned this Oct 24, 2016
@rschamp rschamp merged commit b458d25 into scratchfoundation:master Oct 24, 2016
@rschamp rschamp deleted the scratch-vm-review branch October 24, 2016 15:34
@rschamp
Copy link
Contributor Author

rschamp commented Oct 24, 2016

(Merged so I can update the scratch-vm PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant