-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from number rule settings to string
- Loading branch information
Showing
8 changed files
with
48 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
module.exports = { | ||
rules: { | ||
// require parens in arrow function arguments | ||
'arrow-parens': [ 2, 'as-needed' ], | ||
'arrow-parens': [ 'error', 'as-needed' ], | ||
// ensure default import coupled with default export | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it | ||
'import/default': 2, | ||
'import/default': 'error', | ||
// disallow non-import statements appearing before import statements | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/imports-first.md | ||
'import/imports-first': [ 2, '' ], | ||
'import/imports-first': [ 'error', '' ], | ||
// ensure named imports coupled with named exports | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it | ||
'import/named': 2, | ||
'import/named': 'error', | ||
// ensure new line after last import/require in group | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md | ||
'import/newline-after-import': 2, | ||
'import/newline-after-import': 'error', | ||
// disallow duplicate imports | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md | ||
'import/no-duplicates': 2, | ||
'import/no-duplicates': 'error', | ||
// Forbid the use of extraneous packages | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md | ||
'import/no-extraneous-dependencies': [ 2, { devDependencies: true }], | ||
'import/no-extraneous-dependencies': [ 'error', { devDependencies: true }], | ||
// disallow arrow functions where they could be confused with comparisons | ||
// http://eslint.org/docs/rules/no-confusing-arrow | ||
'no-confusing-arrow': 0, | ||
'no-confusing-arrow': 'off', | ||
// suggest using the spread operator instead of .apply() | ||
'prefer-spread': 2, | ||
'prefer-spread': 'error', | ||
// enforce usage of spacing in template strings | ||
// http://eslint.org/docs/rules/template-curly-spacing | ||
'template-curly-spacing': [ 2, 'never' ], | ||
'template-curly-spacing': [ 'error', 'never' ], | ||
// import sorting | ||
// http://eslint.org/docs/rules/sort-imports | ||
// disabled in favor of `wyze/sort-imports` | ||
'sort-imports': 0, | ||
'sort-imports': 'off', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
rules: { | ||
// specify the maximum number of statement allowed in a function | ||
'max-statements': [ 2, 20 ], | ||
'max-statements': [ 'error', 20 ], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
rules: { | ||
// Maybe revisit this and write custom rules for Preact | ||
'react/no-deprecated': [ 0 ], | ||
'react/no-deprecated': [ 'off' ], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
module.exports = { | ||
rules: { | ||
// enforce spacing inside array brackets | ||
'array-bracket-spacing': [ 2, 'always', { | ||
'array-bracket-spacing': [ 'error', 'always', { | ||
objectsInArrays: false, | ||
arraysInArrays: false, | ||
}], | ||
// specify the maximum length of a line in your program | ||
// https://github.com/eslint/eslint/blob/master/docs/rules/max-len.md | ||
'max-len': [ 2, 80, 2, { | ||
'max-len': [ 'error', 80, 2, { | ||
ignoreUrls: true, | ||
ignoreComments: false, | ||
}], | ||
// allow/disallow an empty newline after var statement | ||
// https://github.com/eslint/eslint/blob/master/docs/rules/newline-after-var.md | ||
'newline-after-var': [ 2, 'always' ], | ||
'newline-after-var': [ 'error', 'always' ], | ||
// Require newline before return statement | ||
// https://github.com/eslint/eslint/tree/master/docs/rules/newline-before-return.md | ||
'newline-before-return': 2, | ||
'newline-before-return': 'error', | ||
// disallow multiple empty lines and only one newline at the end | ||
// https://github.com/eslint/eslint/blob/master/docs/rules/no-multiple-empty-lines.md | ||
'no-multiple-empty-lines': [ 2, { max: 2, maxBOF: 0, maxEOF: 1 }], | ||
'no-multiple-empty-lines': [ 'error', { max: 2, maxBOF: 0, maxEOF: 1 }], | ||
// require or disallow use of semicolons instead of ASI | ||
// I use Babel, it takes care of this for me | ||
semi: [ 2, 'never' ], | ||
semi: [ 'error', 'never' ], | ||
// require or disallow spaces inside parentheses | ||
// disabled, because this rule is strange | ||
// TODO: write and implement a better rule | ||
'space-in-parens': 0, | ||
'space-in-parens': 'off', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters