Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 26, 2021
2 parents 24c8400 + 45532f1 commit 67ad497
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
11 changes: 11 additions & 0 deletions eslint/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ module.exports = {
// Custom rule for ensuring that images and text use scenery node
'no-html-constructors': 2,

// enforce one true brace style
'brace-style': [ 'error', 'stroustrup', { allowSingleLine: true } ],

// Custom rule for avoiding instanceof Array.
'no-instanceof-array': 2,

Expand Down Expand Up @@ -267,6 +270,14 @@ module.exports = {
// require or disallow space before blocks
'space-before-blocks': 'error',

// require or disallow space before function opening parenthesis
// https://eslint.org/docs/rules/space-before-function-paren
'space-before-function-paren': [ 'error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always'
} ],

// require or disallow spaces inside parentheses
'space-in-parens': [ 'error', 'always' ],

Expand Down
25 changes: 5 additions & 20 deletions eslint/format_eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@ module.exports = {

// enforce spacing inside single-line blocks
// https://eslint.org/docs/rules/block-spacing
'block-spacing': [ 'error', 'always' ],

// enforce one true brace style
'brace-style': [ 'error', 'stroustrup', { allowSingleLine: true } ],

// require camel case names
camelcase: [ 'error', { properties: 'never', ignoreDestructuring: false } ],
// Leave it off because Webstorm doesn't add spacing to `() => {this.pLDChanged = true;}` to make it `() => { this.pLDChanged = true; }
// TODO: perhaps update webstorm rules, https://github.com/phetsims/phet-info/issues/150
// 'block-spacing': [ 'error', 'always' ],

// enforce or disallow capitalization of the first letter of a comment
// https://eslint.org/docs/rules/capitalized-comments
Expand All @@ -60,7 +56,8 @@ module.exports = {
} ],

// enforce newline at the end of file, with no multiple empty lines
'eol-last': [ 'error', 'never' ],
// TODO: add to knit picky rules, https://github.com/phetsims/phet-info/issues/150
// 'eol-last': [ 'error', 'never' ],

// requires function names to match the name of the variable or property to which they are
// assigned
Expand Down Expand Up @@ -346,10 +343,6 @@ module.exports = {
// TODO: enable, semver-major when eslint 5 is dropped
'prefer-exponentiation-operator': 'off',

// Prefer use of an object spread over Object.assign
// https://eslint.org/docs/rules/prefer-object-spread
'prefer-object-spread': 'error',

// do not require jsdoc
// https://eslint.org/docs/rules/require-jsdoc
'require-jsdoc': 'off',
Expand All @@ -360,14 +353,6 @@ module.exports = {
// sort variables within the same declaration block
'sort-vars': 'off',

// require or disallow space before function opening parenthesis
// https://eslint.org/docs/rules/space-before-function-paren
'space-before-function-paren': [ 'error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always'
} ],

// require or disallow a space immediately following the // or /* in a comment
// https://eslint.org/docs/rules/spaced-comment
// TODO: https://github.com/phetsims/phet-info/issues/150
Expand Down

0 comments on commit 67ad497

Please sign in to comment.