diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e9a9bff --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..871285a --- /dev/null +++ b/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": ["./index.js"], + "rules": { + "no-magic-numbers": 0 // because rules are 0, 1, 2 + } +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index b512c09..4cc0196 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -node_modules \ No newline at end of file +node_modules +npm-debug.log +yarn-error.log +yarn.lock diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..d0d1a66 --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +node_modules +.editorconfig +.gitignore +.travis.yml diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6802bc4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 71fec4d..ba4069c 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,95 @@ -# eslint-config-casumo -Holds Casumo's base JS .eslintrc as an extensible shared config +

eslint-config-casumo

-## Install +

+ + + + + + + + + + + + +

+ +

+ ESLint shareable config for the Casumo JavaScript code style +

+ +*** + +## Installation ```bash -npm install eslint-config-casumo +npm install --save-dev eslint-config-casumo ``` ## Usage -Add the following to your `.eslintrc` file: -```javascript +Once the `eslint-config-casumo` package is installed, you can use it by specifying `casumo` in the [`extends`](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) section of your [ESLint configuration](http://eslint.org/docs/user-guide/configuring). + +```js { - "extends": "eslint-config-casumo" + "extends": "casumo", + "rules": { + // Additional, per-project rules... + } } -``` \ No newline at end of file +``` + +_Note: We omitted the `eslint-config-` prefix since it is automatically assumed by ESLint._ + +You can override settings from the shareable config by adding them directly into your `.eslintrc` file. + +### Configuration structure +- `casumo/rules/...` - grouping for rules by category (f.ex `eslint`, `mocha`, etc.) + - Each group ideally would have `on/off.js` configurations files which will be used for composing presets +- `causmo/configuration/...` - composition of rules into 'presets' + +#### Why `on.js` and `off.js`? +The idea is to always ship a complete list of ESLint rules and explicitly turn off rule groups which are not needed. This is mostly useful for when `eslint-find-rules` runs. In case any new rule is added the plugin will call out the missing rule. + +For example if we want to completely ignore `ecma-script-6` rules we just extend the configuration preset with `/rules/eslint/ecma-script-6/off.js`. + +### Full configurations + +This package includes the following complete and ready to use configurations: + +- `casumo` - ES5 config +- `casumo/configurations/es5` - ES5 config +- `casumo/configurations/es5-browser` - ES5 + browser +- `casumo/configurations/es5-node` - ES5 + node +- `casumo/configurations/es5-test` - ES5 + test +- `casumo/configurations/es6` - ES6 config +- `casumo/configurations/es6-browser` - ES6 + browser +- `casumo/configurations/es6-node` - ES6 + node +- `casumo/configurations/es6-test` - ES6 + test +- `casumo/configurations/off` - All rules disabled + +## NPM scripts + +- `commit` - use this if you do not have [`commitizen`](https://github.com/commitizen/cz-cli) installed globally +- `lint` - lints the current project +- `find-new-eslint-rules` - checks for new (missing) rules +- `test` - runs a couple of tests + +## Contributing + +To contribute to the project, please follow these steps: + +0. File an issue with the idea you wish to put forward +0. Fork the repo +0. Make a branch for your change +0. Run `npm` or `yarn install` +0. Make your changes +0. Run `npm` or `yarn test` +0. Run `git add -A` to add your changes +0. Run `npm` or `yarn run commit` (do not use git commit - unless you have [`commitizen`](https://github.com/commitizen/cz-cli) installed globally) +0. Push your changes +0. Create the Pull Request +0. Get merged and 🎉! + +## Thanks to +- [eslint-config-walmart](https://github.com/walmartlabs/eslint-config-walmart) - for inspiration diff --git a/configurations/es5-browser.js b/configurations/es5-browser.js new file mode 100644 index 0000000..23679f1 --- /dev/null +++ b/configurations/es5-browser.js @@ -0,0 +1,6 @@ +module.exports = { + extends: './es5.js', + env: { + browser: true + } +}; diff --git a/configurations/es5-node.js b/configurations/es5-node.js new file mode 100644 index 0000000..78e0703 --- /dev/null +++ b/configurations/es5-node.js @@ -0,0 +1,12 @@ +module.exports = { + extends: [ + './es5.js', + '../rules/eslint/node-js-and-common-js/on.js' + ], + env: { + node: true + }, + rules: { + strict: [2, 'global'] + } +}; diff --git a/configurations/es5-test.js b/configurations/es5-test.js new file mode 100644 index 0000000..a7e6d5b --- /dev/null +++ b/configurations/es5-test.js @@ -0,0 +1,13 @@ +module.exports = { + extends: [ + './es5.js', + '../rules/mocha/on.js' + ], + env: { + mocha: true + }, + rules: { + 'max-nested-callbacks': 0, + 'no-magic-numbers': 0 + } +}; diff --git a/configurations/es5.js b/configurations/es5.js new file mode 100644 index 0000000..6b2cbe8 --- /dev/null +++ b/configurations/es5.js @@ -0,0 +1,27 @@ +module.exports = { + extends: [ + '../rules/eslint/best-practices/on.js', + '../rules/eslint/possible-errors/on.js', + '../rules/eslint/ecma-script-6/off.js', + '../rules/eslint/node-js-and-common-js/off.js', + '../rules/eslint/strict-mode/on.js', + '../rules/eslint/stylistic-issues/on.js', + '../rules/eslint/variables/on.js', + // The following line is needed since `eslint-find-rules -u` does not skip deprecated rules. + // This can be removed once https://github.com/sarbbottam/eslint-find-rules/issues/172 is resolved. + '../rules/eslint/deprecated/off.js' + ], + parserOptions: { + ecmaVersion: 5, + sourceType: 'script', + ecmaFeatures: {} + }, + env: { + amd: true + }, + globals: { + module: false, + process: false + }, + rules: {} +}; diff --git a/configurations/es6-browser.js b/configurations/es6-browser.js new file mode 100644 index 0000000..a006c6d --- /dev/null +++ b/configurations/es6-browser.js @@ -0,0 +1,6 @@ +module.exports = { + extends: './es6.js', + env: { + browser: true + } +}; diff --git a/configurations/es6-node-test.js b/configurations/es6-node-test.js new file mode 100644 index 0000000..2c0fa07 --- /dev/null +++ b/configurations/es6-node-test.js @@ -0,0 +1,18 @@ +module.exports = { + extends: [ + './es6-test.js' + ], + env: { + mocha: true, + phantomjs: true + }, + globals: { + expect: true, + sandbox: true + }, + rules: { + 'max-nested-callbacks': 0, + 'no-unused-expressions': 0, + 'no-magic-numbers': 0 + } +}; diff --git a/configurations/es6-node.js b/configurations/es6-node.js new file mode 100644 index 0000000..9d9fb7d --- /dev/null +++ b/configurations/es6-node.js @@ -0,0 +1,24 @@ +module.exports = { + extends: [ + './es6.js', + '../rules/eslint/node-js-and-common-js/on.js' + ], + env: { + node: true + }, + parserOptions: { + sourceType: 'script', + ecmaFeatures: { + impliedStrict: false + } + }, + globals: {}, + rules: { + 'constructor-super': 0, + 'no-class-assign': 0, + 'no-dupe-class-members': 0, + 'no-this-before-super': 0, + 'prefer-reflect': 0, + strict: [2, 'global'] + } +}; diff --git a/configurations/es6-test.js b/configurations/es6-test.js new file mode 100644 index 0000000..843425c --- /dev/null +++ b/configurations/es6-test.js @@ -0,0 +1,13 @@ +module.exports = { + extends: [ + './es6.js' + ], + env: { + mocha: true, + phantomjs: true + }, + rules: { + 'max-nested-callbacks': 0, + 'no-magic-numbers': 0 + } +}; diff --git a/configurations/es6.js b/configurations/es6.js new file mode 100644 index 0000000..c1f9f5d --- /dev/null +++ b/configurations/es6.js @@ -0,0 +1,18 @@ +module.exports = { + extends: [ + './es5.js', + '../rules/eslint/ecma-script-6/on.js' + ], + parserOptions: { + ecmaVersion: 6, + sourceType: 'module', + ecmaFeatures: { + impliedStrict: true + } + }, + env: { + es6: true + }, + globals: {}, + rules: {} +}; diff --git a/configurations/off.js b/configurations/off.js new file mode 100644 index 0000000..64de2a3 --- /dev/null +++ b/configurations/off.js @@ -0,0 +1,22 @@ +module.exports = { + extends: [ + '../rules/eslint/best-practices/off.js', + '../rules/eslint/possible-errors/off.js', + '../rules/eslint/ecma-script-6/off.js', + '../rules/eslint/node-js-and-common-js/off.js', + '../rules/eslint/strict-mode/off.js', + '../rules/eslint/stylistic-issues/off.js', + '../rules/eslint/variables/off.js', + // The following line is needed since `eslint-find-rules -u` does not skip deprecated rules. + // This can be removed once https://github.com/sarbbottam/eslint-find-rules/issues/172 is resolved. + '../rules/eslint/deprecated/off.js' + ], + parserOptions: { + ecmaVersion: 5, + sourceType: 'script', + ecmaFeatures: {} + }, + env: {}, + globals: {}, + rules: {} +}; diff --git a/index.js b/index.js index ebd7c1f..8bbde51 100644 --- a/index.js +++ b/index.js @@ -1,158 +1,5 @@ module.exports = { - env: { - browser: true, - node: true, - es6: true - }, - globals: { - ActiveXObject: true, - define: true, - require: true, - describe: true, - it: true, - beforeEach: true, - afterEach: true, - before: true, - after: true, - should: true, - module: true - }, - rules: { - 'no-bitwise': 2, - 'camelcase': 2, - 'curly': [ - 2, - 'all' - ], - 'eqeqeq': 2, - 'no-eval': 2, - 'no-unused-expressions': 2, - 'guard-for-in': 2, - 'wrap-iife': 2, - 'indent': [ - 2, - 4, - { - SwitchCase: 1 - } - ], - 'no-use-before-define': [ - 'error', - { - functions: false, - classes: true - } - ], - 'func-style': [ - 'error', - 'declaration', - { - allowArrowFunctions: true - } - ], - 'new-cap': 2, - 'no-caller': 2, - 'no-empty': 2, - 'no-new': 2, - 'quotes': [ - 2, - 'single' - ], - 'strict': 0, - 'no-undef': 2, - 'no-unused-vars': 2, - 'keyword-spacing': [ - 2, - {} - ], - 'space-before-blocks': [ - 2, - 'always' - ], - 'space-before-function-paren': [ - 2, - 'always' - ], - 'one-var': [ - 2, - 'always' - ], - 'vars-on-top': 2, - 'array-bracket-spacing': [ - 2, - 'never' - ], - 'space-in-parens': [ - 2, - 'never' - ], - 'no-underscore-dangle': 2, - 'comma-style': [ - 2, - 'last' - ], - 'space-unary-ops': [ - 2, - { - words: false, - nonwords: false - } - ], - 'space-infix-ops': 2, - 'no-with': 2, - 'no-mixed-spaces-and-tabs': 2, - 'no-trailing-spaces': 2, - 'comma-dangle': [ - 2, - 'never' - ], - 'brace-style': 2, - 'eol-last': 2, - 'dot-notation': 2, - 'no-multi-str': 2, - 'key-spacing': [ - 2, - { - afterColon: true - } - ], - 'no-multiple-empty-lines': [ - 2, - { - max: 1, - maxEOF: 1 - } - ], - 'max-len': [ - 2, - 110 - ], - 'newline-after-var': [ - 2, - 'always' - ], - 'max-nested-callbacks': [ - 'error', - 3 - ], - 'max-depth': [ - 'error', - 2 - ], - 'max-statements': [ - 'error', - 20 - ], - 'max-params': [ - 'error', - 10 - ], - 'no-extend-native': 2, - 'no-return-assign': 2, - 'no-undefined': 2, - 'radix': 2, - 'semi': 2, - 'no-extra-semi': 2, - 'no-unreachable': 2 - } -}; \ No newline at end of file + extends: [ + './configurations/es5.js' + ] +}; diff --git a/package.json b/package.json index a74c516..6db9509 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,50 @@ { "name": "eslint-config-casumo", - "version": "1.0.0", - "description": "Holds Casumo's base JS .eslintrc as an extensible shared config", + "version": "1.1.0", + "description": "ESLint shareable config for the Casumo JavaScript code style", "main": "index.js", - "scripts": {}, + "author": "Casumo", + "license": "MIT", + "homepage": "https://github.com/Casumo/eslint-config-casumo#readme", "repository": { "type": "git", - "url": "git+https://github.com/Casumo/eslint-config-casumo.git" + "url": "https://github.com/Casumo/eslint-config-casumo.git" }, - "author": "", - "license": "MIT", "bugs": { "url": "https://github.com/Casumo/eslint-config-casumo/issues" }, - "homepage": "https://github.com/Casumo/eslint-config-casumo#readme" + "scripts": { + "commit": "git-cz", + "commitmsg": "validate-commit-msg", + "lint": "eslint .", + "find-new-eslint-rules:es5-browser": "eslint-find-rules -u ./configurations/es5-browser.js", + "find-new-eslint-rules:es5-node": "eslint-find-rules -u ./configurations/es5-node.js", + "find-new-eslint-rules:es5-test": "eslint-find-rules -u ./configurations/es5-test.js", + "find-new-eslint-rules:es5": "eslint-find-rules -u ./configurations/es5.js", + "find-new-eslint-rules:es6-browser": "eslint-find-rules -u ./configurations/es6-browser.js", + "find-new-eslint-rules:es6-node-test": "eslint-find-rules -u ./configurations/es6-node-test.js", + "find-new-eslint-rules:es6-node": "eslint-find-rules -u ./configurations/es6-node.js", + "find-new-eslint-rules:es6-test": "eslint-find-rules -u ./configurations/es6-test.js", + "find-new-eslint-rules:es6": "eslint-find-rules -u ./configurations/es6.js", + "find-new-eslint-rules:off": "eslint-find-rules -u ./configurations/off.js", + "find-new-eslint-rules": "npm-run-all --parallel find-new-eslint-rules:*", + "test": "npm-run-all --parallel lint find-new-eslint-rules" + }, + "devDependencies": { + "commitizen": "^2.9.2", + "cz-conventional-changelog": "^1.2.0", + "eslint": "^3.12.2", + "eslint-find-rules": "^1.14.3", + "husky": "^0.12.0", + "npm-run-all": "^3.1.2", + "validate-commit-msg": "^2.8.2" + }, + "peerDependencies": { + "eslint": "^3.12.2" + }, + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog" + } + } } diff --git a/rules/eslint/best-practices/off.js b/rules/eslint/best-practices/off.js new file mode 100644 index 0000000..1a3754f --- /dev/null +++ b/rules/eslint/best-practices/off.js @@ -0,0 +1,73 @@ +module.exports = { + rules: { + 'accessor-pairs': 0, + 'array-callback-return': 0, + 'block-scoped-var': 0, + 'class-methods-use-this': 0, + 'complexity': 0, + 'consistent-return': 0, + curly: 0, + 'default-case': 0, + 'dot-location': 0, + 'dot-notation': 0, + eqeqeq: 0, + 'guard-for-in': 0, + 'no-alert': 0, + 'no-caller': 0, + 'no-case-declarations': 0, + 'no-div-regex': 0, + 'no-else-return': 0, + 'no-empty-function': 0, + 'no-empty-pattern': 0, + 'no-eq-null': 0, + 'no-eval': 0, + 'no-extend-native': 0, + 'no-extra-bind': 0, + 'no-extra-label': 0, + 'no-fallthrough': 0, + 'no-floating-decimal': 0, + 'no-global-assign': 0, + 'no-implicit-coercion': 0, + 'no-implicit-globals': 0, + 'no-implied-eval': 0, + 'no-invalid-this': 0, + 'no-iterator': 0, + 'no-labels': 0, + 'no-lone-blocks': 0, + 'no-loop-func': 0, + 'no-magic-numbers': 0, + 'no-multi-spaces': 0, + 'no-multi-str': 0, + 'no-new-func': 0, + 'no-new-wrappers': 0, + 'no-new': 0, + 'no-octal-escape': 0, + 'no-octal': 0, + 'no-param-reassign': 0, + 'no-proto': 0, + 'no-redeclare': 0, + 'no-restricted-properties': 0, + 'no-return-assign': 0, + 'no-return-await': 0, + 'no-script-url': 0, + 'no-self-assign': 0, + 'no-self-compare': 0, + 'no-sequences': 0, + 'no-throw-literal': 0, + 'no-unmodified-loop-condition': 0, + 'no-unused-expressions': 0, + 'no-unused-labels': 0, + 'no-useless-call': 0, + 'no-useless-concat': 0, + 'no-useless-escape': 0, + 'no-useless-return': 0, + 'no-void': 0, + 'no-warning-comments': 0, + 'no-with': 0, + radix: 0, + 'require-await': 0, + 'vars-on-top': 0, + 'wrap-iife': 0, + 'yoda': 0 + } +}; diff --git a/rules/eslint/best-practices/on.js b/rules/eslint/best-practices/on.js new file mode 100644 index 0000000..9433edc --- /dev/null +++ b/rules/eslint/best-practices/on.js @@ -0,0 +1,73 @@ +module.exports = { + rules: { + 'accessor-pairs': 0, + 'array-callback-return': 0, + 'block-scoped-var': 0, + 'class-methods-use-this': 0, + 'complexity': 0, + 'consistent-return': 0, + curly: [2, 'all'], + 'default-case': 0, + 'dot-location': 0, + 'dot-notation': 2, + eqeqeq: 2, + 'guard-for-in': 2, + 'no-alert': 0, + 'no-caller': 2, + 'no-case-declarations': 0, + 'no-div-regex': 0, + 'no-else-return': 0, + 'no-empty-function': 0, + 'no-empty-pattern': 0, + 'no-eq-null': 0, + 'no-eval': 2, + 'no-extend-native': 2, + 'no-extra-bind': 0, + 'no-extra-label': 0, + 'no-fallthrough': 0, + 'no-floating-decimal': 0, + 'no-global-assign': 0, + 'no-implicit-coercion': 0, + 'no-implicit-globals': 0, + 'no-implied-eval': 0, + 'no-invalid-this': 0, + 'no-iterator': 0, + 'no-labels': 0, + 'no-lone-blocks': 0, + 'no-loop-func': 0, + 'no-magic-numbers': 0, + 'no-multi-spaces': 0, + 'no-multi-str': 2, + 'no-new-func': 0, + 'no-new-wrappers': 0, + 'no-new': 2, + 'no-octal-escape': 0, + 'no-octal': 0, + 'no-param-reassign': 0, + 'no-proto': 0, + 'no-redeclare': 0, + 'no-restricted-properties': 0, + 'no-return-assign': 2, + 'no-return-await': 0, + 'no-script-url': 0, + 'no-self-assign': 0, + 'no-self-compare': 0, + 'no-sequences': 0, + 'no-throw-literal': 0, + 'no-unmodified-loop-condition': 0, + 'no-unused-expressions': 2, + 'no-unused-labels': 0, + 'no-useless-call': 0, + 'no-useless-concat': 0, + 'no-useless-escape': 0, + 'no-useless-return': 0, + 'no-void': 0, + 'no-warning-comments': 0, + 'no-with': 2, + radix: 2, + 'require-await': 0, + 'vars-on-top': 2, + 'wrap-iife': 2, + 'yoda': 0 + } +}; diff --git a/rules/eslint/deprecated/off.js b/rules/eslint/deprecated/off.js new file mode 100644 index 0000000..2342d14 --- /dev/null +++ b/rules/eslint/deprecated/off.js @@ -0,0 +1,8 @@ +module.exports = { + rules: { + 'no-native-reassign': 0, + 'no-negated-in-lhs': 0, + 'no-spaced-func': 0, + 'prefer-reflect': 0 + } +}; diff --git a/rules/eslint/ecma-script-6/off.js b/rules/eslint/ecma-script-6/off.js new file mode 100644 index 0000000..d9ebf8f --- /dev/null +++ b/rules/eslint/ecma-script-6/off.js @@ -0,0 +1,34 @@ +module.exports = { + rules: { + 'arrow-body-style': 0, + 'arrow-parens': 0, + 'arrow-spacing': 0, + 'constructor-super': 0, + 'generator-star-spacing': 0, + 'no-class-assign': 0, + 'no-confusing-arrow': 0, + 'no-const-assign': 0, + 'no-dupe-class-members': 0, + 'no-duplicate-imports': 0, + 'no-new-symbol': 0, + 'no-restricted-imports': 0, + 'no-this-before-super': 0, + 'no-useless-computed-key': 0, + 'no-useless-constructor': 0, + 'no-useless-rename': 0, + 'no-var': 0, + 'object-shorthand': 0, + 'prefer-arrow-callback': 0, + 'prefer-const': 0, + 'prefer-numeric-literals': 0, + 'prefer-rest-params': 0, + 'prefer-spread': 0, + 'prefer-template': 0, + 'require-yield': 0, + 'rest-spread-spacing': 0, + 'sort-imports': 0, + 'symbol-description': 0, + 'template-curly-spacing': 0, + 'yield-star-spacing': 0 + } +}; diff --git a/rules/eslint/ecma-script-6/on.js b/rules/eslint/ecma-script-6/on.js new file mode 100644 index 0000000..7486dea --- /dev/null +++ b/rules/eslint/ecma-script-6/on.js @@ -0,0 +1,34 @@ +module.exports = { + rules: { + 'arrow-body-style': 0, + 'arrow-parens': 2, + 'arrow-spacing': 2, + 'constructor-super': 2, + 'generator-star-spacing': 2, + 'no-class-assign': 2, + 'no-confusing-arrow': 0, + 'no-const-assign': 2, + 'no-dupe-class-members': 2, + 'no-duplicate-imports': 0, + 'no-new-symbol': 0, + 'no-restricted-imports': 0, + 'no-this-before-super': 2, + 'no-useless-computed-key': 0, + 'no-useless-constructor': 0, + 'no-useless-rename': 0, + 'no-var': 2, + 'object-shorthand': 2, + 'prefer-arrow-callback': 1, + 'prefer-const': 2, + 'prefer-numeric-literals': 0, + 'prefer-rest-params': 0, + 'prefer-spread': 2, + 'prefer-template': 1, + 'require-yield': 2, + 'rest-spread-spacing': 0, + 'sort-imports': 0, + 'symbol-description': 0, + 'template-curly-spacing': 0, + 'yield-star-spacing': 0 + } +}; diff --git a/rules/eslint/node-js-and-common-js/off.js b/rules/eslint/node-js-and-common-js/off.js new file mode 100644 index 0000000..461075b --- /dev/null +++ b/rules/eslint/node-js-and-common-js/off.js @@ -0,0 +1,14 @@ +module.exports = { + rules: { + 'callback-return': 0, + 'global-require': 0, + 'handle-callback-err': 0, + 'no-mixed-requires': 0, + 'no-new-require': 0, + 'no-path-concat': 0, + 'no-process-env': 0, + 'no-process-exit': 0, + 'no-restricted-modules': 0, + 'no-sync': 0 + } +}; diff --git a/rules/eslint/node-js-and-common-js/on.js b/rules/eslint/node-js-and-common-js/on.js new file mode 100644 index 0000000..9ccb01e --- /dev/null +++ b/rules/eslint/node-js-and-common-js/on.js @@ -0,0 +1,14 @@ +module.exports = { + rules: { + 'callback-return': 2, + 'global-require': 1, + 'handle-callback-err': 0, + 'no-mixed-requires': 2, + 'no-new-require': 2, + 'no-path-concat': 0, + 'no-process-env': 0, + 'no-process-exit': 2, + 'no-restricted-modules': 0, + 'no-sync': 0 + } +}; diff --git a/rules/eslint/possible-errors/off.js b/rules/eslint/possible-errors/off.js new file mode 100644 index 0000000..86c3631 --- /dev/null +++ b/rules/eslint/possible-errors/off.js @@ -0,0 +1,35 @@ +module.exports = { + rules: { + 'no-await-in-loop': 0, + 'no-cond-assign': 0, + 'no-console': 0, + 'no-constant-condition': 0, + 'no-control-regex': 0, + 'no-debugger': 0, + 'no-dupe-args': 0, + 'no-dupe-keys': 0, + 'no-duplicate-case': 0, + 'no-empty-character-class': 0, + 'no-empty': 0, + 'no-ex-assign': 0, + 'no-extra-boolean-cast': 0, + 'no-extra-parens': 0, + 'no-extra-semi': 0, + 'no-func-assign': 0, + 'no-inner-declarations': 0, + 'no-invalid-regexp': 0, + 'no-irregular-whitespace': 0, + 'no-obj-calls': 0, + 'no-prototype-builtins': 0, + 'no-regex-spaces': 0, + 'no-sparse-arrays': 0, + 'no-template-curly-in-string': 0, + 'no-unexpected-multiline': 0, + 'no-unreachable': 0, + 'no-unsafe-finally': 0, + 'no-unsafe-negation': 0, + 'use-isnan': 0, + 'valid-jsdoc': 0, + 'valid-typeof': 0 + } +}; diff --git a/rules/eslint/possible-errors/on.js b/rules/eslint/possible-errors/on.js new file mode 100644 index 0000000..1b28aae --- /dev/null +++ b/rules/eslint/possible-errors/on.js @@ -0,0 +1,35 @@ +module.exports = { + rules: { + 'no-await-in-loop': 0, + 'no-cond-assign': 0, + 'no-console': 0, + 'no-constant-condition': 0, + 'no-control-regex': 0, + 'no-debugger': 0, + 'no-dupe-args': 0, + 'no-dupe-keys': 0, + 'no-duplicate-case': 0, + 'no-empty-character-class': 0, + 'no-empty': 2, + 'no-ex-assign': 0, + 'no-extra-boolean-cast': 0, + 'no-extra-parens': 0, + 'no-extra-semi': 2, + 'no-func-assign': 0, + 'no-inner-declarations': 0, + 'no-invalid-regexp': 0, + 'no-irregular-whitespace': 0, + 'no-obj-calls': 0, + 'no-prototype-builtins': 0, + 'no-regex-spaces': 0, + 'no-sparse-arrays': 0, + 'no-template-curly-in-string': 0, + 'no-unexpected-multiline': 0, + 'no-unreachable': 2, + 'no-unsafe-finally': 0, + 'no-unsafe-negation': 0, + 'use-isnan': 0, + 'valid-jsdoc': 0, + 'valid-typeof': 0 + } +}; diff --git a/rules/eslint/strict-mode/off.js b/rules/eslint/strict-mode/off.js new file mode 100644 index 0000000..faa69fc --- /dev/null +++ b/rules/eslint/strict-mode/off.js @@ -0,0 +1,5 @@ +module.exports = { + rules: { + strict: 0 + } +}; diff --git a/rules/eslint/strict-mode/on.js b/rules/eslint/strict-mode/on.js new file mode 100644 index 0000000..fea0097 --- /dev/null +++ b/rules/eslint/strict-mode/on.js @@ -0,0 +1,5 @@ +module.exports = { + rules: { + strict: [2, 'never'] + } +}; diff --git a/rules/eslint/stylistic-issues/off.js b/rules/eslint/stylistic-issues/off.js new file mode 100644 index 0000000..5479401 --- /dev/null +++ b/rules/eslint/stylistic-issues/off.js @@ -0,0 +1,85 @@ +module.exports = { + rules: { + 'array-bracket-spacing': 0, + 'block-spacing': 0, + 'brace-style': 0, + camelcase: 0, + 'capitalized-comments': 0, + 'comma-dangle': 0, + 'comma-spacing': 0, + 'comma-style': 0, + 'computed-property-spacing': 0, + 'consistent-this': 0, + 'eol-last': 0, + 'func-call-spacing': 0, + 'func-name-matching': 0, + 'func-names': 0, + 'func-style': 0, + 'id-blacklist': 0, + 'id-length': 0, + 'id-match': 0, + indent: 0, + 'jsx-quotes': 0, + 'key-spacing': 0, + 'keyword-spacing': 0, + 'line-comment-position': 0, + 'linebreak-style': 0, + 'lines-around-comment': 0, + 'lines-around-directive': 0, + 'max-depth': 0, + 'max-len': 0, + 'max-lines': 0, + 'max-nested-callbacks': 0, + 'max-params': 0, + 'max-statements-per-line': 0, + 'max-statements': 0, + 'multiline-ternary': 0, + 'new-cap': 0, + 'new-parens': 0, + 'newline-after-var': 0, + 'newline-before-return': 0, + 'newline-per-chained-call': 0, + 'no-array-constructor': 0, + 'no-bitwise': 0, + 'no-continue': 0, + 'no-inline-comments': 0, + 'no-lonely-if': 0, + 'no-mixed-operators': 0, + 'no-mixed-spaces-and-tabs': 0, + 'no-multiple-empty-lines': 0, + 'no-negated-condition': 0, + 'no-nested-ternary': 0, + 'no-new-object': 0, + 'no-plusplus': 0, + 'no-restricted-syntax': 0, + 'no-tabs': 0, + 'no-ternary': 0, + 'no-trailing-spaces': 0, + 'no-underscore-dangle': 0, + 'no-unneeded-ternary': 0, + 'no-whitespace-before-property': 0, + 'object-curly-newline': 0, + 'object-curly-spacing': 0, + 'object-property-newline': 0, + 'one-var-declaration-per-line': 0, + 'one-var': 0, + 'operator-assignment': 0, + 'operator-linebreak': 0, + 'padded-blocks': 0, + 'quote-props': 0, + quotes: 0, + 'require-jsdoc': 0, + 'semi-spacing': 0, + semi: 0, + 'sort-keys': 0, + 'sort-vars': 0, + 'space-before-blocks': 0, + 'space-before-function-paren': 0, + 'space-in-parens': 0, + 'space-infix-ops': 0, + 'space-unary-ops': 0, + 'spaced-comment': 0, + 'unicode-bom': 0, + 'wrap-regex': 0 + } +}; diff --git a/rules/eslint/stylistic-issues/on.js b/rules/eslint/stylistic-issues/on.js new file mode 100644 index 0000000..a0af91a --- /dev/null +++ b/rules/eslint/stylistic-issues/on.js @@ -0,0 +1,85 @@ +module.exports = { + rules: { + 'array-bracket-spacing': [2, 'never'], + 'block-spacing': 0, + 'brace-style': 2, + camelcase: 2, + 'capitalized-comments': 0, + 'comma-dangle': [2, 'never'], + 'comma-spacing': 0, + 'comma-style': [2, 'last'], + 'computed-property-spacing': 0, + 'consistent-this': 0, + 'eol-last': 2, + 'func-call-spacing': 0, + 'func-name-matching': 0, + 'func-names': 0, + 'func-style': ['error', 'declaration', { allowArrowFunctions: true }], + 'id-blacklist': 0, + 'id-length': 0, + 'id-match': 0, + indent: [2, 4, { SwitchCase: 1 }], + 'jsx-quotes': 0, + 'key-spacing': [2, { afterColon: true }], + 'keyword-spacing': [2, {}], + 'line-comment-position': 0, + 'linebreak-style': 0, + 'lines-around-comment': 0, + 'lines-around-directive': 0, + 'max-depth': ['error', 2], + 'max-len': [2, 110], + 'max-lines': 0, + 'max-nested-callbacks': ['error', 3], + 'max-params': ['error', 10], + 'max-statements-per-line': 0, + 'max-statements': ['error', 20], + 'multiline-ternary': 0, + 'new-cap': 2, + 'new-parens': 0, + 'newline-after-var': [2, 'always'], + 'newline-before-return': 0, + 'newline-per-chained-call': 0, + 'no-array-constructor': 0, + 'no-bitwise': 2, + 'no-continue': 0, + 'no-inline-comments': 0, + 'no-lonely-if': 0, + 'no-mixed-operators': 0, + 'no-mixed-spaces-and-tabs': 2, + 'no-multiple-empty-lines': [2, { max: 1, maxEOF: 1 }], + 'no-negated-condition': 0, + 'no-nested-ternary': 0, + 'no-new-object': 0, + 'no-plusplus': 0, + 'no-restricted-syntax': 0, + 'no-tabs': 0, + 'no-ternary': 0, + 'no-trailing-spaces': 2, + 'no-underscore-dangle': 2, + 'no-unneeded-ternary': 0, + 'no-whitespace-before-property': 0, + 'object-curly-newline': 0, + 'object-curly-spacing': 0, + 'object-property-newline': 0, + 'one-var-declaration-per-line': 0, + 'one-var': [2, { var: 'always', let: 'never', const: 'never' }], + 'operator-assignment': 0, + 'operator-linebreak': 0, + 'padded-blocks': 0, + 'quote-props': 0, + quotes: [2, 'single'], + 'require-jsdoc': 0, + 'semi-spacing': 0, + semi: 2, + 'sort-keys': 0, + 'sort-vars': 0, + 'space-before-blocks': [2, 'always'], + 'space-before-function-paren': [2, 'always'], + 'space-in-parens': [2, 'never'], + 'space-infix-ops': 2, + 'space-unary-ops': [2, { words: false, nonwords: false }], + 'spaced-comment': 0, + 'unicode-bom': 0, + 'wrap-regex': 0 + } +}; diff --git a/rules/eslint/variables/off.js b/rules/eslint/variables/off.js new file mode 100644 index 0000000..8636980 --- /dev/null +++ b/rules/eslint/variables/off.js @@ -0,0 +1,16 @@ +module.exports = { + rules: { + 'init-declarations': 0, + 'no-catch-shadow': 0, + 'no-delete-var': 0, + 'no-label-var': 0, + 'no-restricted-globals': 0, + 'no-shadow-restricted-names': 0, + 'no-shadow': 0, + 'no-undef-init': 0, + 'no-undef': 0, + 'no-undefined': 0, + 'no-unused-vars': 0, + 'no-use-before-define': 0 + } +}; diff --git a/rules/eslint/variables/on.js b/rules/eslint/variables/on.js new file mode 100644 index 0000000..7f5977d --- /dev/null +++ b/rules/eslint/variables/on.js @@ -0,0 +1,16 @@ +module.exports = { + rules: { + 'init-declarations': 0, + 'no-catch-shadow': 0, + 'no-delete-var': 0, + 'no-label-var': 0, + 'no-restricted-globals': 0, + 'no-shadow-restricted-names': 0, + 'no-shadow': 0, + 'no-undef-init': 0, + 'no-undef': 2, + 'no-undefined': 2, + 'no-unused-vars': 2, + 'no-use-before-define': ['error', { functions: false, classes: true }] + } +}; diff --git a/rules/mocha/on.js b/rules/mocha/on.js new file mode 100644 index 0000000..ad77de4 --- /dev/null +++ b/rules/mocha/on.js @@ -0,0 +1,5 @@ +module.exports = { + globals: { + should: true + } +};