From 81cd4d08bb6fab696836f3222ed4acf8243d7517 Mon Sep 17 00:00:00 2001 From: Alasdair Mercer Date: Thu, 3 May 2018 12:18:18 +0100 Subject: [PATCH 1/3] reset all rules and now building on top of eslint:recommended configuration --- README.md | 3 + es5.js | 305 +----------------------------------------------------- es6.js | 43 +------- es7.js | 3 + es8.js | 5 +- es9.js | 3 + 6 files changed, 13 insertions(+), 349 deletions(-) diff --git a/README.md b/README.md index 86b1f27..cc41395 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,9 @@ type for any version, if desired. | 8 (2017) | `"notninja/es8"` | `"notninja/esm8"` | | 9 (2018) | `"notninja/es9"` | `"notninja/esm9"` | +By design, all rules that are specific to !ninja are applied on top of the +[eslint:recommended](https://eslint.org/docs/user-guide/configuring#using-eslintrecommended) configuration. + ## Bugs If you have any problems or would like to see changes currently in development you can do so diff --git a/es5.js b/es5.js index fde76b0..631b9c4 100644 --- a/es5.js +++ b/es5.js @@ -23,312 +23,11 @@ 'use strict'; module.exports = { + extends: 'eslint:recommended', parserOptions: { ecmaVersion: 5 }, rules: { - 'for-direction': 'error', - 'no-compare-neg-zero': 'error', - 'no-cond-assign': 'error', - 'no-console': 'error', - 'no-constant-condition': 'error', - 'no-control-regex': 'error', - 'no-debugger': 'error', - 'no-dupe-args': 'error', - 'no-dupe-keys': 'error', - 'no-duplicate-case': 'error', - 'no-empty': 'error', - 'no-empty-character-class': 'error', - 'no-ex-assign': 'error', - 'no-extra-boolean-cast': 'error', - 'no-extra-parens': [ - 'error', - 'all', - { - 'nestedBinaryExpressions': false - } - ], - 'no-extra-semi': 'error', - 'no-func-assign': 'error', - 'no-inner-declarations': 'error', - 'no-invalid-regexp': 'error', - 'no-irregular-whitespace': 'error', - 'no-obj-calls': 'error', - 'no-prototype-builtins': 'error', - 'no-regex-spaces': 'error', - 'no-sparse-arrays': 'error', - 'no-template-curly-in-string': 'error', - 'no-unexpected-multiline': 'error', - 'no-unreachable': 'error', - 'no-unsafe-finally': 'error', - 'no-unsafe-negation': 'error', - 'use-isnan': 'error', - 'valid-jsdoc': 'error', - 'valid-typeof': 'error', - - 'accessor-pairs': 'error', - 'array-callback-return': 'error', - 'block-scoped-var': 'error', - 'complexity': 'warn', - 'consistent-return': 'warn', - 'curly': 'error', - 'default-case': 'warn', - 'dot-location': [ - 'error', - 'property' - ], - 'dot-notation': 'error', - 'eqeqeq': [ - 'error', - 'always', - { - 'null': 'ignore' - } - ], - 'guard-for-in': 'error', - 'no-alert': 'error', - 'no-caller': 'error', - 'no-case-declarations': 'error', - 'no-div-regex': 'error', - 'no-else-return': 'warn', - 'no-empty-function': 'off', - 'no-eq-null': 'off', - 'no-eval': 'error', - 'no-extend-native': 'error', - 'no-extra-bind': 'warn', - 'no-extra-label': 'error', - 'no-fallthrough': 'warn', - 'no-floating-decimal': 'error', - 'no-global-assign': 'error', - 'no-implicit-coercion': 'error', - 'no-implicit-globals': 'error', - 'no-implied-eval': 'error', - 'no-invalid-this': 'error', - 'no-iterator': 'error', - 'no-labels': 'error', - 'no-lone-blocks': 'error', - 'no-loop-func': 'error', - 'no-magic-numbers': 'off', - 'no-multi-spaces': 'error', - 'no-multi-str': 'error', - 'no-new': 'error', - 'no-new-func': 'error', - 'no-new-wrappers': 'error', - 'no-octal': 'error', - 'no-octal-escape': 'error', - 'no-param-reassign': 'off', - 'no-proto': 'error', - 'no-redeclare': 'error', - 'no-return-assign': 'error', - 'no-script-url': 'error', - 'no-self-assign': 'error', - 'no-self-compare': 'error', - 'no-sequences': 'error', - 'no-throw-literal': 'error', - 'no-unmodified-loop-condition': 'error', - 'no-unused-expressions': 'warn', - 'no-unused-labels': 'error', - 'no-useless-call': 'error', - 'no-useless-concat': 'error', - 'no-useless-escape': 'error', - 'no-useless-return': 'error', - 'no-void': 'error', - 'no-warning-comments': 'warn', - 'no-with': 'error', - 'radix': 'error', - 'vars-on-top': 'off', - 'wrap-iife': 'error', - 'yoda': 'off', - - 'strict': 'error', - - 'init-declarations': 'off', - 'no-catch-shadow': 'error', - 'no-delete-var': 'error', - 'no-label-var': 'error', - 'no-restricted-globals': 'error', - 'no-shadow': 'error', - 'no-shadow-restricted-names': 'error', - 'no-undef': 'error', - 'no-undef-init': 'error', - 'no-undefined': 'error', - 'no-unused-vars': [ - 'warn', - { - 'args': 'none' - } - ], - 'no-use-before-define': [ - 'error', - { - 'functions': false - } - ], - - 'callback-return': 'warn', - 'global-require': 'error', - 'handle-callback-err': 'warn', - 'no-buffer-constructor': 'error', - 'no-mixed-requires': 'warn', - 'no-new-require': 'error', - 'no-path-concat': 'error', - 'no-process-env': 'error', - 'no-process-exit': 'error', - 'no-restricted-modules': 'off', - 'no-sync': 'off', - - 'array-bracket-newline': 'off', - 'array-bracket-spacing': [ - 'error', - 'always' - ], - 'array-element-newline': 'off', - 'block-spacing': 'error', - 'brace-style': 'error', - 'camelcase': 'error', - 'capitalized-comments': 'error', - 'comma-dangle': 'error', - 'comma-spacing': 'error', - 'comma-style': 'error', - 'computed-property-spacing': 'error', - 'consistent-this': 'off', - 'eol-last': [ - 'error', - 'unix' - ], - 'func-call-spacing': 'error', - 'func-name-matching': 'error', - 'func-names': [ - 'error', - 'never' - ], - 'func-style': 'off', - 'id-blacklist': 'off', - 'id-length': 'off', - 'id-match': 'off', - 'indent': [ - 'error', - 2 - ], - 'jsx-quotes': 'error', - 'key-spacing': 'error', - 'keyword-spacing': 'error', - 'line-comment-position': [ - 'error', - { - 'position': 'above' - } - ], - 'linebreak-style': [ - 'error', - 'unix' - ], - 'lines-around-comment': 'off', - 'max-depth': 'warn', - 'max-len': [ - 'warn', - 120, - 2 - ], - 'max-lines': 'off', - 'max-nested-callbacks': [ - 'error', - 10 - ], - 'max-params': [ - 'error', - 5 - ], - 'max-statements': 'off', - 'max-statements-per-line': [ - 'error', - { - 'max': 1 - } - ], - 'multiline-ternary': 'off', - 'new-cap': 'error', - 'new-parens': 'error', - 'newline-per-chained-call': 'off', - 'no-array-constructor': 'error', - 'no-bitwise': 'warn', - 'no-continue': 'off', - 'no-inline-comments': 'error', - 'no-lonely-if': 'error', - 'no-mixed-operators': 'warn', - 'no-mixed-spaces-and-tabs': 'error', - 'no-multi-assign': 'error', - 'no-multiple-empty-lines': 'error', - 'no-negated-condition': 'off', - 'no-nested-ternary': 'warn', - 'no-new-object': 'error', - 'no-plusplus': 'off', - 'no-restricted-syntax': 'off', - 'no-tabs': 'error', - 'no-ternary': 'off', - 'no-trailing-spaces': 'error', - 'no-underscore-dangle': 'off', - 'no-unneeded-ternary': 'error', - 'no-whitespace-before-property': 'error', - 'nonblock-statement-body-position': [ - 'error', - 'below' - ], - 'object-curly-newline': 'off', - 'object-curly-spacing': [ - 'error', - 'always' - ], - 'object-property-newline': 'off', - 'one-var': [ - 'error', - { - 'initialized': 'never' - } - ], - 'one-var-declaration-per-line': 'error', - 'operator-assignment': 'warn', - 'operator-linebreak': 'error', - 'padded-blocks': [ - 'error', - { - 'blocks': 'never', - 'classes': 'always', - 'switches': 'never' - } - ], - 'padding-line-between-statements': 'off', - 'quote-props': [ - 'error', - 'consistent-as-needed' - ], - 'quotes': [ - 'error', - 'single' - ], - 'require-jsdoc': 'off', - 'semi': [ - 'error', - 'always' - ], - 'semi-spacing': 'error', - 'semi-style': [ - 'error', - 'last' - ], - 'sort-keys': 'off', - 'sort-vars': 'off', - 'space-before-blocks': 'error', - 'space-before-function-paren': [ - 'error', - 'never' - ], - 'space-in-parens': 'error', - 'space-infix-ops': 'error', - 'space-unary-ops': 'error', - 'spaced-comment': 'error', - 'switch-colon-spacing': 'error', - 'unicode-bom': 'error', - 'wrap-regex': 'off' + // ECMAScript 5 rules for !ninja can be found below } }; diff --git a/es6.js b/es6.js index 63d8249..a24de5b 100644 --- a/es6.js +++ b/es6.js @@ -31,47 +31,6 @@ module.exports = { ecmaVersion: 6 }, rules: { - 'class-methods-use-this': 'off', - 'no-empty-pattern': 'error', - 'prefer-promise-reject-errors': 'error', - 'template-tag-spacing': [ - 'error', - 'never' - ], - - 'arrow-body-style': 'off', - 'arrow-parens': [ - 'error', - 'always' - ], - 'arrow-spacing': 'error', - 'constructor-super': 'warn', - 'generator-star-spacing': 'error', - 'no-class-assign': 'error', - 'no-confusing-arrow': 'error', - 'no-const-assign': 'error', - 'no-dupe-class-members': 'error', - 'no-duplicate-imports': 'error', - 'no-new-symbol': 'error', - 'no-restricted-imports': 'off', - 'no-this-before-super': 'error', - 'no-useless-computed-key': 'error', - 'no-useless-constructor': 'warn', - 'no-useless-rename': 'error', - 'no-var': 'error', - 'object-shorthand': 'warn', - 'prefer-arrow-callback': 'warn', - 'prefer-const': 'warn', - 'prefer-destructuring': 'off', - 'prefer-numeric-literals': 'warn', - 'prefer-rest-params': 'warn', - 'prefer-spread': 'warn', - 'prefer-template': 'error', - 'require-yield': 'error', - 'rest-spread-spacing': 'error', - 'sort-imports': 'off', - 'symbol-description': 'warn', - 'template-curly-spacing': 'error', - 'yield-star-spacing': 'error' + // ECMAScript 6 (2015) rules for !ninja can be found below } }; diff --git a/es7.js b/es7.js index 689b756..f7e692c 100644 --- a/es7.js +++ b/es7.js @@ -26,5 +26,8 @@ module.exports = { extends: './es6.js', parserOptions: { ecmaVersion: 7 + }, + rules: { + // ECMAScript 7 (2016) rules for !ninja can be found below } }; diff --git a/es8.js b/es8.js index 9a4ec6b..ab23426 100644 --- a/es8.js +++ b/es8.js @@ -28,9 +28,6 @@ module.exports = { ecmaVersion: 8 }, rules: { - 'no-await-in-loop': 'error', - - 'no-return-await': 'error', - 'require-await': 'error' + // ECMAScript 8 (2017) rules for !ninja can be found below } }; diff --git a/es9.js b/es9.js index 355b650..6b9ec68 100644 --- a/es9.js +++ b/es9.js @@ -26,5 +26,8 @@ module.exports = { extends: './es8.js', parserOptions: { ecmaVersion: 9 + }, + rules: { + // ECMAScript 9 (2018) rules for !ninja can be found below } }; From 5646033c63a57131668881f400f765b46849f660 Mon Sep 17 00:00:00 2001 From: Alasdair Mercer Date: Thu, 3 May 2018 12:22:21 +0100 Subject: [PATCH 2/3] roll 0.3.0 --- CHANGES.md | 4 ++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c88bb03..b2e103d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +## Version 0.3.0, 2018.05.03 + +* Reset all rules and start fresh by extending the `eslint:recommended` configuration + ## Version 0.2.4, 2018.05.03 * Simplify how default configuration is managed diff --git a/package-lock.json b/package-lock.json index edfd3c3..f0e9191 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { "name": "eslint-config-notninja", - "version": "0.2.4", + "version": "0.3.0", "lockfileVersion": 1 } diff --git a/package.json b/package.json index c7bcf7e..77a422a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-notninja", - "version": "0.2.4", + "version": "0.3.0", "description": "Standard ESLint configurations for !ninja packages", "homepage": "https://github.com/NotNinja/eslint-config-notninja", "bugs": { From f9ccf350727caffcfd20720acd6bfb3d401dec78 Mon Sep 17 00:00:00 2001 From: Alasdair Mercer Date: Thu, 3 May 2018 12:24:22 +0100 Subject: [PATCH 3/3] highlight breaking change in changelog --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index b2e103d..ff964e6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ ## Version 0.3.0, 2018.05.03 -* Reset all rules and start fresh by extending the `eslint:recommended` configuration +* Reset all rules and start fresh by extending the `eslint:recommended` configuration (**breaking change**) ## Version 0.2.4, 2018.05.03