Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

[BREAKING CHANGE] Upgrade ESLint to v6 #127

Merged
merged 5 commits into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions config/eslintrc_core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// XXX: To uniform the style of an object literals, we enable `quote-props`
/*eslint quote-props: [2, "always"] no-magic-numbers: 0 */
/* eslint quote-props: ['error', "always"] no-magic-numbers: 0 */

'use strict';

Expand Down Expand Up @@ -55,7 +55,7 @@ module.exports = {
// So we regard this rule as meaningless actually and disable this.
'require-atomic-updates ': 0, // https://eslint.org/docs/rules/require-atomic-updates
'use-isnan': 2, // Use `Number.isNaN`
'valid-typeof': [1, {'requireStringLiterals': true}],
'valid-typeof': [1, { 'requireStringLiterals': true }],

// Best Practices
'accessor-pairs': 0, // Allow only getter or setter to define a "read-only" or "write-only" object
Expand Down Expand Up @@ -116,7 +116,7 @@ module.exports = {
'props': true
}],
'no-proto': 2,
'no-redeclare': 2,
'no-redeclare': ['error', { 'builtinGlobals': true }],
'no-restricted-properties': 0, // https://eslint.org/docs/rules/no-restricted-properties
'no-return-assign': 2, // This is a problem for readability.
'no-return-await': 1, // Warn. Because this is not a serious problem which is same degree with `no-return-assign`.
Expand Down Expand Up @@ -180,7 +180,7 @@ module.exports = {
'init-declarations': 'off',
'no-delete-var': 2, // In a general case, we don't have to do this.
'no-label-var': 2,
'no-restricted-globals' : [2, // https://eslint.org/docs/rules/no-restricted-globals
'no-restricted-globals': [2, // https://eslint.org/docs/rules/no-restricted-globals
'name', 'top', 'event'
],
'no-shadow': 0,
Expand Down Expand Up @@ -256,6 +256,8 @@ module.exports = {
// but it would be good to allow both forms of declaration/expression.
'allowArrowFunctions': true,
}],
// Strictly, this should be handled by the formatter.
'function-paren-newline': ['error', 'multiline'],
'id-blacklist': 0, // https://eslint.org/docs/rules/id-blacklist
'id-length': 0, // https://eslint.org/docs/rules/id-length
'id-match': 0, // https://eslint.org/docs/rules/id-match
Expand Down Expand Up @@ -333,7 +335,7 @@ module.exports = {
'nonblock-statement-body-position': 0, // https://eslint.org/docs/rules/nonblock-statement-body-position
'object-curly-newline': 0, // Just case by case! https://eslint.org/docs/rules/object-curly-newline
'object-curly-spacing': 0, // https://eslint.org/docs/rules/object-curly-spacing
'object-property-newline' : 0, // Disable to allow many properties into single line.
'object-property-newline': 0, // Disable to allow many properties into single line.
'one-var': [2, 'never'], // https://eslint.org/docs/rules/one-var
'one-var-declaration-per-line': 1, // https://eslint.org/docs/rules/one-var-declaration-per-line
'operator-assignment': 0, // Unlike `i++` or `++i`, this is not a problem
Expand All @@ -360,7 +362,7 @@ module.exports = {
}],
'quote-props': 0, // `bar-foo` without quote will be parse error if we disable this rules.
'semi': [2, 'always'], // Enfoce semicolon.
'semi-spacing':[2, { // Ban a space char before semicolon.
'semi-spacing': [2, { // Ban a space char before semicolon.
'before': false,
'after': true
}],
Expand Down
8 changes: 5 additions & 3 deletions config/eslintrc_import.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// XXX: To uniform the style of an object literals, we enable `quote-props`
/*eslint-enable quote-props: [2, "always"], no-magic-numbers: 0 */
/*eslint quote-props: ['error', 'always'], no-magic-numbers: 0 */

'use strict';

Expand All @@ -9,7 +9,7 @@
* or by chaning Node.js ES Module support.
*/

/* eslint-enable sort-keys: 'error' */
/* eslint sort-keys: 'error' */
const possibleErrors = {
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md
'import/default': 'error',
Expand Down Expand Up @@ -136,14 +136,16 @@ const styleguide = {
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-default-export.md
// default export is hard to find a usage of symbols.
'import/no-default-export': 'error',
'import/no-named-export': 'off', // This is inverse of `no-default-export`.

// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
'import/no-duplicates': 'warn',

// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
'import/no-named-default': 'off',

// This is inverse of `no-default-export`.
'import/no-named-export': 'off',

// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
'import/no-namespace': 'off',

Expand Down
2 changes: 1 addition & 1 deletion config/eslintrc_node.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// XXX: To uniform the style of an object literals, we enable `quote-props`
/*eslint quote-props: [2, "always"] no-magic-numbers: 0 */
/* eslint quote-props: ['error', "always"] no-magic-numbers: 'off' */

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion config/eslintrc_react.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// XXX: To uniform the style of an object literals, we enable `quote-props`
/*eslint quote-props: [2, "always"] no-magic-numbers: 0 */
/* eslint quote-props: ['error', "always"] no-magic-numbers: 'off' */

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion config/eslintrc_react_hooks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// XXX: To uniform the style of an object literals, we enable `quote-props`
/*eslint quote-props: [2, "always"] no-magic-numbers: 0 */
/* eslint quote-props: ['error', "always"] no-magic-numbers: 'off' */

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion config/eslintrc_typescript.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// XXX: To uniform the style of an object literals, we enable `quote-props`
/*eslint quote-props: [2, "always"] no-magic-numbers: 0 */
/* eslint quote-props: ['error', "always"] no-magic-numbers: 'off' */

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion config/eslintrc_typescript_react.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// XXX: To uniform the style of an object literals, we enable `quote-props`
/*eslint quote-props: [2, "always"] no-magic-numbers: 0 */
/* eslint quote-props: ['error', "always"] no-magic-numbers: 'off' */

'use strict';

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"homepage": "https://github.com/cats-oss/eslint-config-abema",
"peerDependencies": {
"eslint": "^5.15.3"
"eslint": "^6.0.0"
},
"optionalDependencies": {
"@typescript-eslint/eslint-plugin": "^1.11.0",
Expand All @@ -31,7 +31,7 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^1.11.0",
"@typescript-eslint/parser": "^1.11.0",
"eslint": "^5.16.0",
"eslint": "^6.0.0",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-node": "^9.1.0",
Expand Down
2 changes: 1 addition & 1 deletion test/import/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// XXX: To uniform the style of an object literals, we enable `quote-props`
/*eslint quote-props: [2, "always"] no-magic-numbers: 0 */
/* eslint quote-props: ['error', "always"] no-magic-numbers: 'off' */

// eslint-disable-next-line strict
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion test/react/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// XXX: To uniform the style of an object literals, we enable `quote-props`
/*eslint quote-props: [2, "always"] no-magic-numbers: 0 */
/* eslint quote-props: ['error', "always"] no-magic-numbers: 'off' */

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion test/typescript/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// XXX: To uniform the style of an object literals, we enable `quote-props`
/*eslint quote-props: [2, "always"] no-magic-numbers: 0 */
/* eslint quote-props: ['error', "always"] no-magic-numbers: 'off' */
/* eslint-env node */

// eslint-disable-next-line strict
Expand Down