├── .editorconfig ├── .eslintrc ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── configurations ├── es5-browser.js ├── es5-node.js ├── es5-test.js ├── es5.js ├── es6-browser.js ├── es6-node-test.js ├── es6-node.js ├── es6-react-test.js ├── es6-react.js ├── es6-test.js ├── es6.js └── off.js ├── package.json └── rules ├── eslint ├── best-practices │ ├── off.js │ └── on.js ├── errors │ ├── off.js │ └── on.js ├── es6 │ ├── off.js │ └── on.js ├── node │ ├── off.js │ └── on.js ├── strict │ ├── off.js │ └── on.js ├── style │ ├── off.js │ └── on.js └── variables │ ├── off.js │ └── on.js ├── filenames ├── off.js └── on.js ├── import ├── off.js └── on.js ├── promise ├── off.js └── on.js └── react ├── off.js └── on.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | --- 2 | extends: 3 | # We're manually approximating `configurations/es5-node` with these 4 | # _local_ imports (since `defaults/` prefix assumes npm-installed). 5 | - "./rules/eslint/best-practices/on.js" 6 | - "./rules/eslint/errors/on.js" 7 | - "./rules/eslint/es6/off.js" 8 | - "./rules/eslint/node/off.js" 9 | - "./rules/eslint/strict/on.js" 10 | - "./rules/eslint/style/on.js" 11 | - "./rules/eslint/variables/on.js" 12 | - "./rules/filenames/on.js" 13 | - "./rules/import/on.js" 14 | - "./rules/eslint/node/on.js" 15 | 16 | parserOptions: 17 | ecmaVersion: 5 18 | sourceType: "script" 19 | ecmaFeatures: {} 20 | 21 | env: 22 | amd: true 23 | node: true 24 | 25 | globals: 26 | module: false 27 | process: false 28 | 29 | rules: 30 | "strict": [2, "global"] 31 | "no-magic-numbers": 0 # Magic numbers _define_ the rule settings. 32 | "max-len": 0 # Bias towards comments / rules on _one line_ 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # -------------------- 2 | # OSX Files 3 | # -------------------- 4 | .DS_Store 5 | .AppleDouble 6 | .LSOverride 7 | Icon 8 | ._* 9 | .Spotlight-V100 10 | .Trashes 11 | npm-debug.log* 12 | 13 | # -------------------- 14 | # Sublime Text Files 15 | # -------------------- 16 | *.sublime-project 17 | *.sublime-workspace 18 | 19 | # -------------------- 20 | # IntelliJ Files 21 | # -------------------- 22 | *.iml 23 | *.ipr 24 | *.iws 25 | .idea/ 26 | out/ 27 | 28 | # -------------------- 29 | # Eclipse Files 30 | # -------------------- 31 | .project 32 | .metadata 33 | *.bak 34 | .classpath 35 | .settings 36 | 37 | # -------------------- 38 | # App Files 39 | # -------------------- 40 | node_modules 41 | yarn.lock 42 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - "4" 5 | - "6" 6 | 7 | # Use container-based Travis infrastructure. 8 | sudo: false 9 | 10 | branches: 11 | only: 12 | - master 13 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 4.0.0 (2018-04-02) 2 | 3 | #### User Facing Changes 4 | 5 | * add promise rules 6 | * add Jest to test configurations 7 | * add options to consistent-return and import/no-unresolved 8 | * fix bug in configurations/off.js 9 | 10 | ## 3.0.0 (2017-05-15) 11 | 12 | #### User Facing Changes 13 | 14 | * Update configurations for consistency 15 | * Update eslint 2.10.2 => 3.19.0 (No new rules enabled) 16 | 17 | ## 2.0.1 (2016-09-28) 18 | 19 | #### User Facing Changes 20 | 21 | * Enforce filenames on all files, even ESnext files with `export default`. 22 | [#28](https://github.com/FormidableLabs/eslint-config-formidable/pull/28) 23 | 24 | ## 2.0.0 (2016-09-28) 25 | 26 | _Bad release. Ignore._ 27 | 28 | ## 1.0.1 (2016-08-17) 29 | 30 | #### User Facing Changes 31 | 32 | * Correct bad path in es6-node config [#24](https://github.com/FormidableLabs/eslint-config-formidable/pull/24) 33 | 34 | * Add contributing docs to README [#23](https://github.com/FormidableLabs/eslint-config-formidable/pull/22) 35 | 36 | #### Internal Changes 37 | 38 | * Use Eslint 2.10.2 [#21](https://github.com/FormidableLabs/eslint-config-formidable/pull/21) 39 | 40 | ## 1.0.0 (2016-08-15) 41 | 42 | * Initial Release 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Formidable Labs, Inc. 4 | 5 | Copyright (c) 2015 Keith Cirkel 6 | 7 | Copyright (c) 2015 Eric Baer 8 | 9 | Copyright (c) 2015 @WalmartLabs 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in 19 | all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | THE SOFTWARE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # eslint-config-formidable 2 | 3 | #### A composable set of ESLint configurations. 4 | [![Build Status](https://travis-ci.com/FormidableLabs/eslint-config-formidable.svg?branch=master)](https://travis-ci.com/FormidableLabs/eslint-config-formidable) 5 | [![npm](https://img.shields.io/npm/v/eslint-config-formidable.svg?maxAge=2592000)](https://www.npmjs.com/package/eslint-config-formidable) 6 | 7 | This project is based on [eslint-config-walmart](https://github.com/walmartlabs/eslint-config-walmart) and maintained by Formidable. It supports ESLint 2, 3, and 4. 8 | 9 | ## Installation 10 | 11 | Install ESLint and this config package: 12 | 13 | ```bash 14 | $ npm install --save-dev eslint eslint-config-formidable 15 | ``` 16 | 17 | Depending on the [configutation](#usage) you choose, you'll most likely need one or more [additional eslint plugins](#dependencies) installed: 18 | 19 | ```bash 20 | $ npm install --save-dev eslint-config- eslint-config- 21 | ``` 22 | 23 | ## Usage 24 | 25 | ### Full Configurations 26 | 27 | This package includes the following complete and ready to use configurations: 28 | 29 | - `formidable` - ES6 config 30 | - `formidable/configurations/off` - Disable all rules (ESLint's default at 1.0.0+) 31 | - `formidable/configurations/es5-browser` - ES5 + browser 32 | - `formidable/configurations/es5-node` - ES5 + node < 4.x 33 | - `formidable/configurations/es5-test` - ES5 + test 34 | - `formidable/configurations/es5` - ES5 config 35 | - `formidable/configurations/es6-browser` - ES6 + browser 36 | - `formidable/configurations/es6-node` - ES6 + node 4.x 37 | - `formidable/configurations/es6-react-test` - ES6 + react + test 38 | - `formidable/configurations/es6-react` - ES6 + react 39 | - `formidable/configurations/es6-test` - ES6 + test 40 | - `formidable/configurations/es6` - ES6 config 41 | 42 | ###### Dependencies 43 | 44 | - Any config (`formidable/configurations/`) 45 | - [eslint-plugin-filenames](https://www.npmjs.com/package/eslint-plugin-filenames) 46 | - [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import) 47 | - [eslint-plugin-promise](https://www.npmjs.com/package/eslint-plugin-promise) 48 | - Any React config (`-react`) 49 | - [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) 50 | - [babel-eslint](https://www.npmjs.com/package/babel-eslint) 51 | - Any ES-next config (`es6-`) 52 | - [babel-eslint](https://www.npmjs.com/package/babel-eslint) 53 | 54 | To consume and extend a config in ESLint just add the extends attribute to your `.eslintrc`. For 55 | more details about how shareable configs work, see the 56 | [ESLint documentation](http://eslint.org/docs/developer-guide/shareable-configs). 57 | 58 | ```yaml 59 | --- 60 | "extends": 61 | - "formidable" 62 | ``` 63 | 64 | ```yaml 65 | --- 66 | "extends": 67 | - "formidable/configurations/es6-browser" 68 | ``` 69 | 70 | ### Piecemeal Configurations 71 | 72 | ESLint configuration is broken apart in `./rules` containing ESLint's rules and rules for specific ESLint plugins. The full set of ESLint rules (`./rules/eslint`) are broken into categories that mirror ESLint's documentation. Under each rule type there are sets of configuration as well as an `off.js` file which turns off every rule in the category. 73 | 74 | ###### Examples 75 | 76 | ```yaml 77 | --- 78 | "extends": 79 | - "formidable/rules/eslint/best-practices/on", 80 | - "formidable/rules/eslint/es6/off" 81 | - "formidable/rules/eslint/node/off" 82 | 83 | "env": 84 | "phantom": true 85 | ``` 86 | 87 | ## Limitations 88 | 89 | Due to an issue with ESLint, config extension cannot be called from a globally installed (`npm install -g eslint`) eslint. It can however be run properly using eslint installed directly to your package's `node_modules`. This can be done by either calling it directly (`./node_modules/.bin/eslint .`) or from within an npm script since they automatically check local `node_modules` first. This will be tracked in issue [#43](https://github.com/walmartlabs/eslint-config-defaults/issues/43). 90 | 91 | ### This package tracks config in the following versions: 92 | 93 | - [ESLint](https://github.com/eslint/eslint) 3.19.0 94 | - [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) 6.0.0 95 | - [eslint-plugin-filenames](https://www.npmjs.com/package/eslint-plugin-filenames) 1.1.0 96 | - [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import) 1.13.0 97 | - [eslint-plugin-promise](https://www.npmjs.com/package/eslint-plugin-promise) 3.7.0 98 | 99 | ## Contributing 100 | 101 | This project defines a huge number of very contentious config variables. In order to prevent issues/PRs from being eternal bikeshedding pits of doom we would like to ask that you *simply upvote or downvote a rule. If you need to explain something please use concrete and reproducible evidence or statistics.* Please try not to post assertions of preference, authority, aesthetic beauty (it's in the eye of the beholder), minimal key presses, cognitive load or any other subjective measures of code style. 102 | 103 | ## And A Special Thanks To 104 | 105 | * [Nicholas C. Zakas](https://github.com/nzakas) for all the amazing work on [ESLint](https://github.com/eslint/eslint) 106 | * [Keith Cirkel](https://github.com/keithamus) for painstakingly formatting all of ESLint's rules into JSON in [eslint-config-strict](https://github.com/keithamus/eslint-config-strict) 107 | * [AirBnB](https://github.com/airbnb/javascript) for sharing all of their config in [JavaScript Style Guide](https://github.com/airbnb/javascript) 108 | * [Google](https://google.github.io/styleguide/javascriptguide.xml) for sharing their styleguide 109 | * [ES-Next Compat Table](https://github.com/kangax/compat-table) for the [excellent docs on node features](https://kangax.github.io/compat-table/es6/#node4) 110 | 111 | *** 112 | 113 | ## License 114 | 115 | [MIT License](http://opensource.org/licenses/MIT) 116 | 117 | 118 | ## Maintenance Status 119 | 120 | **Archived:** This project is no longer maintained by Formidable. We are no longer responding to issues or pull requests unless they relate to security concerns. We encourage interested developers to fork this project and make it their own! 121 | -------------------------------------------------------------------------------- /configurations/es5-browser.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | "extends": "formidable/configurations/es5", 5 | env: { 6 | browser: true 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /configurations/es5-node.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | "extends": [ 5 | "formidable/configurations/es5", 6 | "formidable/rules/eslint/node/on" 7 | ], 8 | env: { 9 | node: true 10 | }, 11 | rules: { 12 | strict: ["error", "global"] 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /configurations/es5-test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | "extends": [ 5 | "formidable/configurations/es5" 6 | ], 7 | env: { 8 | mocha: true, 9 | jest: true, 10 | phantomjs: true 11 | }, 12 | globals: { 13 | expect: true, 14 | sandbox: true 15 | }, 16 | rules: { 17 | "max-nested-callbacks": "off", 18 | "no-unused-expressions": "off" 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /configurations/es5.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | "extends": [ 5 | "formidable/rules/eslint/best-practices/on", 6 | "formidable/rules/eslint/errors/on", 7 | "formidable/rules/eslint/es6/off", 8 | "formidable/rules/eslint/node/off", 9 | "formidable/rules/eslint/strict/on", 10 | "formidable/rules/eslint/style/on", 11 | "formidable/rules/eslint/variables/on", 12 | "formidable/rules/filenames/on", 13 | "formidable/rules/import/on", 14 | "formidable/rules/promise/on" 15 | ], 16 | parserOptions: { 17 | ecmaVersion: 5, 18 | sourceType: "script", 19 | ecmaFeatures: {} 20 | }, 21 | env: { 22 | amd: true 23 | }, 24 | globals: { 25 | module: false, 26 | process: false 27 | }, 28 | rules: {} 29 | }; 30 | -------------------------------------------------------------------------------- /configurations/es6-browser.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | "extends": "formidable/configurations/es6", 5 | env: { 6 | browser: true 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /configurations/es6-node-test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | "extends": [ 5 | "formidable/configurations/es6-node" 6 | ], 7 | env: { 8 | mocha: true, 9 | jest: true, 10 | phantomjs: true 11 | }, 12 | globals: { 13 | expect: true, 14 | sandbox: true 15 | }, 16 | rules: { 17 | "max-nested-callbacks": "off", 18 | "no-unused-expressions": "off" 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /configurations/es6-node.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | "extends": [ 5 | "formidable/configurations/es6", 6 | "formidable/rules/eslint/node/on" 7 | ], 8 | env: { 9 | node: true 10 | }, 11 | parserOptions: { 12 | sourceType: "script", 13 | ecmaFeatures: { 14 | impliedStrict: false 15 | } 16 | }, 17 | globals: {}, 18 | rules: { 19 | // verify super() callings in constructors 20 | "constructor-super": "off", 21 | // disallow modifying variables of class declarations 22 | "no-class-assign": "off", 23 | // disallow modifying variables that are declared using const 24 | "no-dupe-class-members": "off", 25 | // disallow to use this/super before super() calling in constructors. 26 | "no-this-before-super": "off", 27 | // require that all functions are run in strict mode 28 | strict: ["error", "global"] 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /configurations/es6-react-test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | "extends": [ 5 | "formidable/configurations/es6-react" 6 | ], 7 | env: { 8 | mocha: true, 9 | jest: true, 10 | phantomjs: true 11 | }, 12 | globals: { 13 | expect: true, 14 | sandbox: true 15 | }, 16 | rules: { 17 | "max-nested-callbacks": "off", 18 | "no-unused-expressions": "off" 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /configurations/es6-react.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | parser: "babel-eslint", 5 | "extends": [ 6 | "formidable/configurations/es6-browser", 7 | "formidable/rules/react/on" 8 | ], 9 | parserOptions: { 10 | ecmaFeatures: { 11 | jsx: true 12 | } 13 | }, 14 | globals: { 15 | fetch: false 16 | }, 17 | rules: { 18 | "no-extra-parens": "off", 19 | "no-var": "error" 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /configurations/es6-test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | "extends": [ 5 | "formidable/configurations/es6" 6 | ], 7 | env: { 8 | mocha: true, 9 | jest: true, 10 | phantomjs: true 11 | }, 12 | globals: { 13 | expect: true, 14 | sandbox: true 15 | }, 16 | rules: { 17 | "max-nested-callbacks": "off", 18 | "no-unused-expressions": "off" 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /configurations/es6.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | "extends": [ 5 | "formidable/configurations/es5", 6 | "formidable/rules/eslint/es6/on" 7 | ], 8 | parser: "babel-eslint", 9 | parserOptions: { 10 | ecmaVersion: 6, 11 | sourceType: "module", 12 | ecmaFeatures: { 13 | experimentalObjectRestSpread: true, 14 | impliedStrict: true 15 | } 16 | }, 17 | env: { 18 | es6: true 19 | }, 20 | globals: {}, 21 | rules: {} 22 | }; 23 | -------------------------------------------------------------------------------- /configurations/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | "extends": [ 5 | "formidable/rules/eslint/best-practices/off", 6 | "formidable/rules/eslint/errors/off", 7 | "formidable/rules/eslint/es6/off", 8 | "formidable/rules/eslint/node/off", 9 | "formidable/rules/eslint/strict/off", 10 | "formidable/rules/eslint/style/off", 11 | "formidable/rules/eslint/variables/off", 12 | "formidable/rules/filenames/off", 13 | "formidable/rules/import/off", 14 | "formidable/rules/promise/off" 15 | ], 16 | parserOptions: { 17 | ecmaVersion: 5, 18 | sourceType: "script", 19 | ecmaFeatures: {} 20 | }, 21 | env: {}, 22 | globals: {}, 23 | rules: {} 24 | }; 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eslint-config-formidable", 3 | "description": "A set of default eslint configurations from formidable", 4 | "version": "4.0.0", 5 | "authors": "eric.baer@formidable.com, ryan.roemer@formidable.com, kyle.cesmat@formidable.com", 6 | "homepage": "https://github.com/FormidableLabs/eslint-config-formidable", 7 | "bugs": { 8 | "url": "https://github.com/FormidableLabs/eslint-config-formidable/issues" 9 | }, 10 | "repository": "git://github.com/FormidableLabs/eslint-config-formidable.git", 11 | "private": false, 12 | "dependencies": {}, 13 | "devDependencies": { 14 | "babel-eslint": "7.2.3", 15 | "eslint": "3.19.0", 16 | "eslint-plugin-filenames": "1.1.0", 17 | "eslint-plugin-import": "1.13.0", 18 | "eslint-plugin-promise": "3.7.0", 19 | "eslint-plugin-react": "6.0.0" 20 | }, 21 | "main": "configurations/es6.js", 22 | "scripts": { 23 | "fix": "eslint configurations rules --fix", 24 | "test": "eslint configurations rules" 25 | }, 26 | "engines": { 27 | "node": ">= 0.10.0" 28 | }, 29 | "license": "MIT", 30 | "keywords": [ 31 | "code checker", 32 | "code linter", 33 | "code standards", 34 | "code style", 35 | "eslint-config", 36 | "eslint", 37 | "eslintconfig", 38 | "lint", 39 | "style checker", 40 | "style linter" 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /rules/eslint/best-practices/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // Enforces getter/setter pairs in objects 6 | "accessor-pairs": "off", 7 | // enforce return statements in callbacks of array’s methods 8 | "array-callback-return": "off", 9 | // treat var statements as if they were block scoped 10 | "block-scoped-var": "off", 11 | // enforce that class methods utilize this 12 | "class-methods-use-this": "off", 13 | // specify the maximum cyclomatic complexity allowed in a program 14 | complexity: "off", 15 | // require return statements to either always or never specify values 16 | "consistent-return": "off", 17 | // specify curly brace conventions for all control statements 18 | curly: "off", 19 | // require default case in switch statements 20 | "default-case": "off", 21 | // enforces consistent newlines before or after dots 22 | "dot-location": "off", 23 | // encourages use of dot notation whenever possible 24 | "dot-notation": "off", 25 | // require the use of === and !== 26 | eqeqeq: "off", 27 | // make sure for-in loops have an if statement 28 | "guard-for-in": "off", 29 | // disallow the use of alert, confirm, and prompt 30 | "no-alert": "off", 31 | // disallow use of arguments.caller or arguments.callee 32 | "no-caller": "off", 33 | // disallow lexical declarations in case clauses 34 | "no-case-declarations": "off", 35 | // disallow division operators explicitly at beginning of regular expression 36 | "no-div-regex": "off", 37 | // disallow else after a return in an if 38 | "no-else-return": "off", 39 | // disallow use of empty functions 40 | "no-empty-function": "off", 41 | // disallow use of empty destructuring patterns 42 | "no-empty-pattern": "off", 43 | // disallow comparisons to null without a type-checking operator 44 | "no-eq-null": "off", 45 | // disallow use of eval() 46 | "no-eval": "off", 47 | // disallow adding to native types 48 | "no-extend-native": "off", 49 | // disallow unnecessary function binding 50 | "no-extra-bind": "off", 51 | // disallow unnecessary labels 52 | "no-extra-label": "off", 53 | // disallow fallthrough of case statements 54 | "no-fallthrough": "off", 55 | // disallow the use of leading or trailing decimal points in numeric literals 56 | "no-floating-decimal": "off", 57 | // disallow assignments to native objects or read-only global variables 58 | "no-global-assign": "off", 59 | // disallow the type conversions with shorter notations 60 | "no-implicit-coercion": "off", 61 | // disallow var and named functions in global scope 62 | "no-implicit-globals": "off", 63 | // disallow use of eval()-like methods 64 | "no-implied-eval": "off", 65 | // disallow this keywords outside of classes or class-like objects 66 | "no-invalid-this": "off", 67 | // disallow usage of __iterator__ property 68 | "no-iterator": "off", 69 | // disallow use of labeled statements 70 | "no-labels": "off", 71 | // disallow unnecessary nested blocks 72 | "no-lone-blocks": "off", 73 | // disallow creation of functions within loops 74 | "no-loop-func": "off", 75 | // disallow the use of magic numbers 76 | "no-magic-numbers": "off", 77 | // disallow use of multiple spaces 78 | "no-multi-spaces": "off", 79 | // disallow use of multiline strings 80 | "no-multi-str": "off", 81 | // disallow use of new operator when not part of the assignment or comparison 82 | "no-new": "off", 83 | // disallow use of new operator for Function object 84 | "no-new-func": "off", 85 | // disallows creating new instances of String,Number, and Boolean 86 | "no-new-wrappers": "off", 87 | // disallow use of (old style) octal literals 88 | "no-octal": "off", 89 | // disallow use of octal escape sequences in string literals, such as 90 | // var foo = "Copyright \251"; 91 | "no-octal-escape": "off", 92 | // disallow reassignment of function parameters 93 | "no-param-reassign": "off", 94 | // disallow usage of __proto__ property 95 | "no-proto": "off", 96 | // disallow declaring the same variable more then once 97 | "no-redeclare": "off", 98 | // disallow certain properties on certain objects 99 | "no-restricted-properties": "off", 100 | // disallow use of assignment in return statement 101 | "no-return-assign": "off", 102 | // disallow unnecessary return await 103 | "no-return-await": "off", 104 | // disallow use of `javascript:` urls. 105 | "no-script-url": "off", 106 | // disallow assignments where both sides are exactly the same 107 | "no-self-assign": "off", 108 | // disallow comparisons where both sides are exactly the same 109 | "no-self-compare": "off", 110 | // disallow use of comma operator 111 | "no-sequences": "off", 112 | // restrict what can be thrown as an exception 113 | "no-throw-literal": "off", 114 | // disallow unmodified conditions of loops 115 | "no-unmodified-loop-condition": "off", 116 | // disallow usage of expressions in statement position 117 | "no-unused-expressions": "off", 118 | // disallow unused labels 119 | "no-unused-labels": "off", 120 | // disallow unnecessary .call() and .apply() 121 | "no-useless-call": "off", 122 | // disallow unnecessary concatenation of literals or template literals 123 | "no-useless-concat": "off", 124 | // disallow unnecessary usage of escape character 125 | "no-useless-escape": "off", 126 | // disallow redundant return statements 127 | "no-useless-return": "off", 128 | // disallow use of void operator 129 | "no-void": "off", 130 | // disallow usage of configurable warning terms in comments: e.g. todo 131 | "no-warning-comments": "off", 132 | // disallow use of the with statement 133 | "no-with": "off", 134 | // require using Error objects as Promise rejection reasons 135 | "prefer-promise-reject-errors": "off", 136 | // require use of the second argument for parseInt() 137 | radix: "off", 138 | // disallow async functions which have no await expression 139 | "require-await": "off", 140 | // requires to declare all vars on top of their containing scope 141 | "vars-on-top": "off", 142 | // require immediate function invocation to be wrapped in parentheses 143 | "wrap-iife": "off", 144 | // require or disallow Yoda conditions 145 | yoda: "off" 146 | } 147 | }; 148 | -------------------------------------------------------------------------------- /rules/eslint/best-practices/on.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // Enforces getter/setter pairs in objects 6 | "accessor-pairs": "off", 7 | // enforce return statements in callbacks of array’s methods 8 | "array-callback-return": "off", 9 | // treat var statements as if they were block scoped 10 | "block-scoped-var": "off", 11 | // enforce that class methods utilize this 12 | "class-methods-use-this": "off", 13 | // specify the maximum cyclomatic complexity allowed in a program 14 | complexity: ["error", 11], 15 | // require return statements to either always or never specify values 16 | "consistent-return": ["error", { treatUndefinedAsUnspecified: true }], 17 | // specify curly brace conventions for all control statements 18 | curly: ["error", "all"], 19 | // require default case in switch statements 20 | "default-case": "off", 21 | // enforces consistent newlines before or after dots 22 | "dot-location": ["error", "property"], 23 | // encourages use of dot notation whenever possible 24 | "dot-notation": ["error", { allowKeywords: true }], 25 | // require the use of === and !== 26 | eqeqeq: "error", 27 | // make sure for-in loops have an if statement 28 | "guard-for-in": "off", 29 | // disallow the use of alert, confirm, and prompt 30 | "no-alert": "error", 31 | // disallow use of arguments.caller or arguments.callee 32 | "no-caller": "error", 33 | // disallow lexical declarations in case clauses 34 | "no-case-declarations": "error", 35 | // disallow division operators explicitly at beginning of regular expression 36 | "no-div-regex": "off", 37 | // disallow else after a return in an if 38 | "no-else-return": "error", 39 | // disallow use of empty functions 40 | "no-empty-function": "off", 41 | // disallow use of empty destructuring patterns 42 | "no-empty-pattern": "error", 43 | // disallow comparisons to null without a type-checking operator 44 | "no-eq-null": "off", 45 | // disallow use of eval() 46 | "no-eval": "error", 47 | // disallow adding to native types 48 | "no-extend-native": "error", 49 | // disallow unnecessary function binding 50 | "no-extra-bind": "error", 51 | // disallow unnecessary labels 52 | "no-extra-label": "error", 53 | // disallow fallthrough of case statements 54 | "no-fallthrough": "error", 55 | // disallow the use of leading or trailing decimal points in numeric literals 56 | "no-floating-decimal": "error", 57 | // disallow assignments to native objects or read-only global variables 58 | "no-global-assign": "off", 59 | // disallow the type conversions with shorter notations 60 | "no-implicit-coercion": ["error", { allow: ["!!"] }], 61 | // disallow var and named functions in global scope 62 | "no-implicit-globals": "off", 63 | // disallow use of eval()-like methods 64 | "no-implied-eval": "error", 65 | // disallow this keywords outside of classes or class-like objects 66 | "no-invalid-this": "error", 67 | // disallow usage of __iterator__ property 68 | "no-iterator": "error", 69 | // disallow use of labeled statements 70 | "no-labels": ["error", { allowLoop: true, 71 | allowSwitch: true }], 72 | // disallow unnecessary nested blocks 73 | "no-lone-blocks": "error", 74 | // disallow creation of functions within loops 75 | "no-loop-func": "error", 76 | // disallow the use of magic numbers 77 | "no-magic-numbers": ["error", { ignore: [-1, 0, 1] }], 78 | // disallow use of multiple spaces 79 | "no-multi-spaces": "error", 80 | // disallow use of multiline strings 81 | "no-multi-str": "error", 82 | // disallow use of new operator when not part of the assignment or comparison 83 | "no-new": "error", 84 | // disallow use of new operator for Function object 85 | "no-new-func": "error", 86 | // disallows creating new instances of String,Number, and Boolean 87 | "no-new-wrappers": "error", 88 | // disallow use of (old style) octal literals 89 | "no-octal": "error", 90 | // disallow use of octal escape sequences in string literals, such as 91 | // var foo = "Copyright \251"; 92 | "no-octal-escape": "error", 93 | // disallow reassignment of function parameters 94 | "no-param-reassign": "off", 95 | // disallow usage of __proto__ property 96 | "no-proto": "error", 97 | // disallow declaring the same variable more then once 98 | "no-redeclare": "error", 99 | // disallow certain properties on certain objects 100 | "no-restricted-properties": "off", 101 | // disallow use of assignment in return statement 102 | "no-return-assign": "error", 103 | // disallow unnecessary return await 104 | "no-return-await": "off", 105 | // disallow use of `javascript:` urls. 106 | "no-script-url": "error", 107 | // disallow assignments where both sides are exactly the same 108 | "no-self-assign": "off", 109 | // disallow comparisons where both sides are exactly the same 110 | "no-self-compare": "error", 111 | // disallow use of comma operator 112 | "no-sequences": "error", 113 | // restrict what can be thrown as an exception 114 | "no-throw-literal": "error", 115 | // disallow unmodified conditions of loops 116 | "no-unmodified-loop-condition": "off", 117 | // disallow usage of expressions in statement position 118 | "no-unused-expressions": "error", 119 | // disallow unused labels 120 | "no-unused-labels": "error", 121 | // disallow unnecessary .call() and .apply() 122 | "no-useless-call": "error", 123 | // disallow unnecessary concatenation of literals or template literals 124 | "no-useless-concat": "error", 125 | // disallow unnecessary usage of escape character 126 | "no-useless-escape": "off", 127 | // disallow redundant return statements 128 | "no-useless-return": "error", 129 | // disallow use of void operator 130 | "no-void": "off", 131 | // disallow usage of configurable warning terms in comments: e.g. todo 132 | "no-warning-comments": "off", 133 | // disallow use of the with statement 134 | "no-with": "error", 135 | // require using Error objects as Promise rejection reasons 136 | "prefer-promise-reject-errors": "off", 137 | // require use of the second argument for parseInt() 138 | radix: "off", 139 | // disallow async functions which have no await expression 140 | "require-await": "off", 141 | // requires to declare all vars on top of their containing scope 142 | "vars-on-top": "off", 143 | // require immediate function invocation to be wrapped in parentheses 144 | "wrap-iife": ["error", "inside"], 145 | // require or disallow Yoda conditions 146 | yoda: ["error", "never"] 147 | } 148 | }; 149 | -------------------------------------------------------------------------------- /rules/eslint/errors/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // disallow await inside of loops 6 | "no-await-in-loop": "off", 7 | // disallow comparing against -0 8 | "no-compare-neg-zero": "off", 9 | // disallow assignment in conditional expressions 10 | "no-cond-assign": "off", 11 | // disallow use of console 12 | "no-console": "off", 13 | // disallow use of constant expressions in conditions 14 | "no-constant-condition": "off", 15 | // disallow control characters in regular expressions 16 | "no-control-regex": "off", 17 | // disallow use of debugger 18 | "no-debugger": "off", 19 | // disallow duplicate arguments in functions 20 | "no-dupe-args": "off", 21 | // disallow duplicate keys when creating object literals 22 | "no-dupe-keys": "off", 23 | // disallow a duplicate case label. 24 | "no-duplicate-case": "off", 25 | // disallow empty statements 26 | "no-empty": "off", 27 | // disallow the use of empty character classes in regular expressions 28 | "no-empty-character-class": "off", 29 | // disallow assigning to the exception in a catch block 30 | "no-ex-assign": "off", 31 | // disallow double-negation boolean casts in a boolean context 32 | "no-extra-boolean-cast": "off", 33 | // disallow unnecessary parentheses 34 | "no-extra-parens": "off", 35 | // disallow unnecessary semicolons 36 | "no-extra-semi": "off", 37 | // disallow overwriting functions written as function declarations 38 | "no-func-assign": "off", 39 | // disallow function or variable declarations in nested blocks 40 | "no-inner-declarations": "off", 41 | // disallow invalid regular expression strings in the RegExp constructor 42 | "no-invalid-regexp": "off", 43 | // disallow irregular whitespace outside of strings and comments 44 | "no-irregular-whitespace": "off", 45 | // disallow the use of object properties of the global object (Math and JSON) as functions 46 | "no-obj-calls": "off", 47 | // disallow calling some Object.prototype methods directly on objects 48 | "no-prototype-builtins": "off", 49 | // disallow multiple spaces in a regular expression literal 50 | "no-regex-spaces": "off", 51 | // disallow sparse arrays 52 | "no-sparse-arrays": "off", 53 | // disallow template literal placeholder syntax in regular strings 54 | "no-template-curly-in-string": "off", 55 | // Avoid code that looks like two expressions but is actually one 56 | "no-unexpected-multiline": "off", 57 | // disallow unreachable statements after a return, throw, continue, or break statement 58 | "no-unreachable": "off", 59 | // disallow control flow statements in finally blocks 60 | "no-unsafe-finally": "off", 61 | // disallow negating the left operand of relational operators 62 | "no-unsafe-negation": "off", 63 | // disallow comparisons with the value NaN 64 | "use-isnan": "off", 65 | // ensure JSDoc comments are valid 66 | "valid-jsdoc": "off", 67 | // ensure that the results of typeof are compared against a valid string 68 | "valid-typeof": "off" 69 | } 70 | }; 71 | -------------------------------------------------------------------------------- /rules/eslint/errors/on.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // disallow await inside of loops 6 | "no-await-in-loop": "off", 7 | // disallow comparing against -0 8 | "no-compare-neg-zero": "off", 9 | // disallow assignment in conditional expressions 10 | "no-cond-assign": "error", 11 | // disallow use of console 12 | "no-console": "error", 13 | // disallow use of constant expressions in conditions 14 | "no-constant-condition": "error", 15 | // disallow control characters in regular expressions 16 | "no-control-regex": "error", 17 | // disallow use of debugger 18 | "no-debugger": "error", 19 | // disallow duplicate arguments in functions 20 | "no-dupe-args": "error", 21 | // disallow duplicate keys when creating object literals 22 | "no-dupe-keys": "error", 23 | // disallow a duplicate case label. 24 | "no-duplicate-case": "error", 25 | // disallow empty statements 26 | "no-empty": "error", 27 | // disallow the use of empty character classes in regular expressions 28 | "no-empty-character-class": "error", 29 | // disallow assigning to the exception in a catch block 30 | "no-ex-assign": "error", 31 | // disallow double-negation boolean casts in a boolean context 32 | "no-extra-boolean-cast": "error", 33 | // disallow unnecessary parentheses 34 | "no-extra-parens": "error", 35 | // disallow unnecessary semicolons 36 | "no-extra-semi": "error", 37 | // disallow overwriting functions written as function declarations 38 | "no-func-assign": "error", 39 | // disallow function or variable declarations in nested blocks 40 | "no-inner-declarations": ["error", "functions"], 41 | // disallow invalid regular expression strings in the RegExp constructor 42 | "no-invalid-regexp": "error", 43 | // disallow irregular whitespace outside of strings and comments 44 | "no-irregular-whitespace": "error", 45 | // disallow the use of object properties of the global object (Math and JSON) as functions 46 | "no-obj-calls": "error", 47 | // disallow calling some Object.prototype methods directly on objects 48 | "no-prototype-builtins": "off", 49 | // disallow multiple spaces in a regular expression literal 50 | "no-regex-spaces": "error", 51 | // disallow sparse arrays 52 | "no-sparse-arrays": "error", 53 | // disallow template literal placeholder syntax in regular strings 54 | "no-template-curly-in-string": "off", 55 | // Avoid code that looks like two expressions but is actually one 56 | "no-unexpected-multiline": "error", 57 | // disallow unreachable statements after a return, throw, continue, or break statement 58 | "no-unreachable": "error", 59 | // disallow control flow statements in finally blocks 60 | "no-unsafe-finally": "off", 61 | // disallow negating the left operand of relational operators 62 | "no-unsafe-negation": "error", 63 | // disallow comparisons with the value NaN 64 | "use-isnan": "error", 65 | // ensure JSDoc comments are valid 66 | "valid-jsdoc": "error", 67 | // ensure that the results of typeof are compared against a valid string 68 | "valid-typeof": "error" 69 | } 70 | }; 71 | -------------------------------------------------------------------------------- /rules/eslint/es6/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // require braces in arrow function body 6 | "arrow-body-style": "off", 7 | // require parens in arrow function arguments 8 | "arrow-parens": "off", 9 | // require space before/after arrow function's arrow 10 | "arrow-spacing": "off", 11 | // verify super() callings in constructors 12 | "constructor-super": "off", 13 | // enforce the spacing around the * in generator functions 14 | "generator-star-spacing": "off", 15 | // disallow modifying variables of class declarations 16 | "no-class-assign": "off", 17 | // disallow arrow functions where they could be confused with comparisons 18 | "no-confusing-arrow": "off", 19 | // disallow modifying variables that are declared using const 20 | "no-const-assign": "off", 21 | // disallow duplicate name in class members 22 | "no-dupe-class-members": "off", 23 | // disallow duplicate module imports 24 | "no-duplicate-imports": "off", 25 | // disallow use of the new operator with the Symbol object 26 | "no-new-symbol": "off", 27 | // restrict usage of specified modules when loaded by import declaration 28 | "no-restricted-imports": "off", 29 | // disallow to use this/super before super() calling in constructors. 30 | "no-this-before-super": "off", 31 | // disallow unnecessary computed property keys in object literals 32 | "no-useless-computed-key": "off", 33 | // disallow unnecessary constructor 34 | "no-useless-constructor": "off", 35 | // disallow renaming import, export, and destructured assignments to the same name 36 | "no-useless-rename": "off", 37 | // require let or const instead of var 38 | "no-var": "off", 39 | // require method and property shorthand syntax for object literals 40 | "object-shorthand": "off", 41 | // suggest using arrow functions as callbacks 42 | "prefer-arrow-callback": "off", 43 | // suggest using of const declaration for variables that are never modified after declared 44 | "prefer-const": "off", 45 | // require destructuring from arrays and/or objects 46 | "prefer-destructuring": "off", 47 | // disallow parseInt() in favor of binary, octal, and hexadecimal literals 48 | "prefer-numeric-literals": "off", 49 | // suggest using the rest parameters instead of arguments 50 | "prefer-rest-params": "off", 51 | // suggest using the spread operator instead of .apply() 52 | "prefer-spread": "off", 53 | // suggest using template literals instead of strings concatenation 54 | "prefer-template": "off", 55 | // disallow generator functions that do not have yield 56 | "require-yield": "off", 57 | // enforce spacing between rest and spread operators and their expressions 58 | "rest-spread-spacing": "off", 59 | // enforce sorted import declarations within modules 60 | "sort-imports": "off", 61 | // require symbol descriptions 62 | "symbol-description": "off", 63 | // enforce spacing around embedded expressions of template strings 64 | "template-curly-spacing": "off", 65 | // enforce spacing around the * in yield* expressions 66 | "yield-star-spacing": "off" 67 | } 68 | }; 69 | -------------------------------------------------------------------------------- /rules/eslint/es6/on.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // require braces in arrow function body 6 | "arrow-body-style": ["error", "as-needed"], 7 | // require parens in arrow function arguments 8 | "arrow-parens": "error", 9 | // require space before/after arrow function's arrow 10 | "arrow-spacing": "error", 11 | // verify super() callings in constructors 12 | "constructor-super": "error", 13 | // enforce the spacing around the * in generator functions 14 | "generator-star-spacing": "error", 15 | // disallow modifying variables of class declarations 16 | "no-class-assign": "error", 17 | // disallow arrow functions where they could be confused with comparisons 18 | "no-confusing-arrow": "off", 19 | // disallow modifying variables that are declared using const 20 | "no-const-assign": "error", 21 | // disallow duplicate name in class members 22 | "no-dupe-class-members": "error", 23 | // disallow duplicate module imports 24 | "no-duplicate-imports": "off", 25 | // disallow use of the new operator with the Symbol object 26 | "no-new-symbol": "off", 27 | // restrict usage of specified modules when loaded by import declaration 28 | "no-restricted-imports": "off", 29 | // disallow to use this/super before super() calling in constructors. 30 | "no-this-before-super": "error", 31 | // disallow unnecessary computed property keys in object literals 32 | "no-useless-computed-key": "error", 33 | // disallow unnecessary constructor 34 | "no-useless-constructor": "off", 35 | // disallow renaming import, export, and destructured assignments to the same name 36 | "no-useless-rename": "error", 37 | // require let or const instead of var 38 | "no-var": "error", 39 | // require method and property shorthand syntax for object literals 40 | "object-shorthand": "error", 41 | // suggest using arrow functions as callbacks 42 | "prefer-arrow-callback": "warn", 43 | // suggest using of const declaration for variables that are never modified after declared 44 | "prefer-const": "error", 45 | // require destructuring from arrays and/or objects 46 | "prefer-destructuring": "off", 47 | // disallow parseInt() in favor of binary, octal, and hexadecimal literals 48 | "prefer-numeric-literals": "error", 49 | // suggest using the rest parameters instead of arguments 50 | "prefer-rest-params": "off", 51 | // suggest using the spread operator instead of .apply() 52 | "prefer-spread": "error", 53 | // suggest using template literals instead of strings concatenation 54 | "prefer-template": "warn", 55 | // disallow generator functions that do not have yield 56 | "require-yield": "error", 57 | // enforce spacing between rest and spread operators and their expressions 58 | "rest-spread-spacing": "error", 59 | // enforce sorted import declarations within modules 60 | "sort-imports": "off", 61 | // require symbol descriptions 62 | "symbol-description": "off", 63 | // enforce spacing around embedded expressions of template strings 64 | "template-curly-spacing": "error", 65 | // enforce spacing around the * in yield* expressions 66 | "yield-star-spacing": ["error", "after"] 67 | } 68 | }; 69 | -------------------------------------------------------------------------------- /rules/eslint/node/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // enforce return after a callback 6 | "callback-return": "off", 7 | // disallow require() outside of the top-level module scope 8 | "global-require": "off", 9 | // enforces error handling in callbacks (node environment) 10 | "handle-callback-err": "off", 11 | // disallow mixing regular variable and require declarations 12 | "no-mixed-requires": "off", 13 | // disallow use of new operator with the require function 14 | "no-new-require": "off", 15 | // disallow string concatenation with __dirname and __filename 16 | "no-path-concat": "off", 17 | // disallow use of process.env 18 | "no-process-env": "off", 19 | // disallow process.exit() 20 | "no-process-exit": "off", 21 | // restrict usage of specified node modules 22 | "no-restricted-modules": "off", 23 | // disallow use of synchronous methods (off by default) 24 | "no-sync": "off" 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /rules/eslint/node/on.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // enforce return after a callback 6 | "callback-return": "error", 7 | // disallow require() outside of the top-level module scope 8 | "global-require": "warn", 9 | // enforces error handling in callbacks (node environment) 10 | "handle-callback-err": "off", 11 | // disallow mixing regular variable and require declarations 12 | "no-mixed-requires": "error", 13 | // disallow use of new operator with the require function 14 | "no-new-require": "error", 15 | // disallow string concatenation with __dirname and __filename 16 | "no-path-concat": "off", 17 | // disallow use of process.env 18 | "no-process-env": "off", 19 | // disallow process.exit() 20 | "no-process-exit": "error", 21 | // restrict usage of specified node modules 22 | "no-restricted-modules": "off", 23 | // disallow use of synchronous methods (off by default) 24 | "no-sync": "off" 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /rules/eslint/strict/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // require that all functions are run in strict mode 6 | strict: "off" 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /rules/eslint/strict/on.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // require that all functions are run in strict mode 6 | strict: ["error", "never"] 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /rules/eslint/style/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // enforce spacing inside array brackets 6 | "array-bracket-spacing": "off", 7 | // disallow or enforce spaces inside of single line blocks 8 | "block-spacing": "off", 9 | // enforce one true brace style 10 | "brace-style": "off", 11 | // require camel case names 12 | camelcase: "off", 13 | // enforce or disallow capitalization of the first letter of a comment 14 | "capitalized-comments": "off", 15 | // disallow trailing commas in object literals 16 | "comma-dangle": "off", 17 | // enforce spacing before and after comma 18 | "comma-spacing": "off", 19 | // enforce one true comma style 20 | "comma-style": "off", 21 | // require or disallow padding inside computed properties 22 | "computed-property-spacing": "off", 23 | // enforces consistent naming when capturing the current execution context 24 | "consistent-this": "off", 25 | // enforce newline at the end of file, with no multiple empty lines 26 | "eol-last": "off", 27 | // require or disallow spacing between function identifiers and their invocations 28 | "func-call-spacing": "off", 29 | // require function names to match the name of the variable or property to which they are assigned 30 | "func-name-matching": "off", 31 | // require function expressions to have a name 32 | "func-names": "off", 33 | // enforces use of function declarations or expressions 34 | "func-style": "off", 35 | // disallow certain identifiers to prevent them being used 36 | "id-blacklist": "off", 37 | // this option enforces minimum and maximum identifier lengths (variable names, property names etc.) 38 | "id-length": "off", 39 | // require identifiers to match the provided regular expression 40 | "id-match": "off", 41 | // this option sets a specific tab width for your code 42 | indent: "off", 43 | // specify whether double or single quotes should be used in JSX attributes 44 | "jsx-quotes": "off", 45 | // enforces spacing between keys and values in object literal properties 46 | "key-spacing": "off", 47 | // enforce spacing before and after keywords 48 | "keyword-spacing": "off", 49 | // enforce position of line comments 50 | "line-comment-position": "off", 51 | // disallow mixed "LF" and "CRLF" as linebreaks 52 | "linebreak-style": "off", 53 | // enforces empty lines around comments 54 | "lines-around-comment": "off", 55 | // require or disallow newlines around directives 56 | "lines-around-directive": "off", 57 | // specify the maximum depth that blocks can be nested 58 | "max-depth": "off", 59 | // specify the maximum length of a line in your program 60 | "max-len": "off", 61 | // enforce a maximum number of lines per file 62 | "max-lines": "off", 63 | // specify the maximum depth callbacks can be nested 64 | "max-nested-callbacks": "off", 65 | // limits the number of parameters that can be used in the function declaration. 66 | "max-params": "off", 67 | // specify the maximum number of statement allowed in a function 68 | "max-statements": "off", 69 | // specify the maximum number of statements allowed per line 70 | "max-statements-per-line": "off", 71 | // enforce newlines between operands of ternary expressions 72 | "multiline-ternary": "off", 73 | // require a capital letter for constructors 74 | "new-cap": "off", 75 | // disallow the omission of parentheses when invoking a constructor with no arguments 76 | "new-parens": "off", 77 | // allow/disallow an empty newline after var statement 78 | "newline-after-var": "off", 79 | // require newline before return statement 80 | "newline-before-return": "off", 81 | // enforce newline after each call when chaining the calls 82 | "newline-per-chained-call": "off", 83 | // disallow use of the Array constructor 84 | "no-array-constructor": "off", 85 | // disallow use of bitwise operators 86 | "no-bitwise": "off", 87 | // disallow use of the continue statement 88 | "no-continue": "off", 89 | // disallow comments inline after code 90 | "no-inline-comments": "off", 91 | // disallow if as the only statement in an else block 92 | "no-lonely-if": "off", 93 | // disallow mixed binary operators 94 | "no-mixed-operators": "off", 95 | // disallow mixed spaces and tabs for indentation 96 | "no-mixed-spaces-and-tabs": "off", 97 | // disallow use of chained assignment expressions 98 | "no-multi-assign": "off", 99 | // disallow multiple empty lines 100 | "no-multiple-empty-lines": "off", 101 | // disallow negated conditions 102 | "no-negated-condition": "off", 103 | // disallow nested ternary expressions 104 | "no-nested-ternary": "off", 105 | // disallow use of the Object constructor 106 | "no-new-object": "off", 107 | // disallow use of unary operators, ++ and -- 108 | "no-plusplus": "off", 109 | // disallow use of certain syntax in code 110 | "no-restricted-syntax": "off", 111 | // disallow all tabs 112 | "no-tabs": "off", 113 | // disallow the use of ternary operators 114 | "no-ternary": "off", 115 | // disallow trailing whitespace at the end of lines 116 | "no-trailing-spaces": "off", 117 | // disallow dangling underscores in identifiers 118 | "no-underscore-dangle": "off", 119 | // disallow the use of Boolean literals in conditional expressions 120 | "no-unneeded-ternary": "off", 121 | // disallow whitespace before properties 122 | "no-whitespace-before-property": "off", 123 | // enforce the location of single-line statements 124 | "nonblock-statement-body-position": "off", 125 | // enforce consistent line breaks inside braces 126 | "object-curly-newline": "off", 127 | // require or disallow padding inside curly braces 128 | "object-curly-spacing": "off", 129 | // enforce placing object properties on separate lines 130 | "object-property-newline": "off", 131 | // allow just one var statement per function 132 | "one-var": "off", 133 | // require or disallow an newline around variable declarations 134 | "one-var-declaration-per-line": "off", 135 | // require assignment operator shorthand where possible or prohibit it entirely 136 | "operator-assignment": "off", 137 | // enforce operators to be placed before or after line breaks 138 | "operator-linebreak": "off", 139 | // enforce padding within blocks 140 | "padded-blocks": "off", 141 | // require quotes around object literal property names 142 | "quote-props": "off", 143 | // specify whether double or single quotes should be used 144 | quotes: "off", 145 | // Require JSDoc comment 146 | "require-jsdoc": "off", 147 | // require or disallow use of semicolons instead of ASI 148 | semi: "off", 149 | // enforce spacing before and after semicolons 150 | "semi-spacing": "off", 151 | // require object keys to be sorted 152 | "sort-keys": "off", 153 | // sort variables within the same declaration block 154 | "sort-vars": "off", 155 | // require or disallow space before blocks 156 | "space-before-blocks": "off", 157 | // require or disallow space before function opening parenthesis 158 | "space-before-function-paren": "off", 159 | // require or disallow spaces inside parentheses 160 | "space-in-parens": "off", 161 | // require spaces around operators 162 | "space-infix-ops": "off", 163 | // Require or disallow spaces before/after unary operators 164 | "space-unary-ops": "off", 165 | // require or disallow a space immediately following the // or /* in a comment 166 | "spaced-comment": "off", 167 | // require or disallow spacing between template tags and their literals 168 | "template-tag-spacing": "off", 169 | // require or disallow Unicode byte order mark (BOM) 170 | "unicode-bom": "off", 171 | // require regex literals to be wrapped in parentheses 172 | "wrap-regex": "off" 173 | } 174 | }; 175 | -------------------------------------------------------------------------------- /rules/eslint/style/on.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // enforce spacing inside array brackets 6 | "array-bracket-spacing": ["error", "never"], 7 | // disallow or enforce spaces inside of single line blocks 8 | "block-spacing": ["error", "always"], 9 | // enforce one true brace style 10 | "brace-style": ["error", "1tbs", { allowSingleLine: true }], 11 | // require camel case names 12 | camelcase: "error", 13 | // enforce or disallow capitalization of the first letter of a comment 14 | "capitalized-comments": "off", 15 | // disallow trailing commas in object literals 16 | "comma-dangle": ["error", "never"], 17 | // enforce spacing before and after comma 18 | "comma-spacing": "error", 19 | // enforce one true comma style 20 | "comma-style": ["error", "last"], 21 | // require or disallow padding inside computed properties 22 | "computed-property-spacing": ["off", "never"], 23 | // enforces consistent naming when capturing the current execution context 24 | "consistent-this": ["error", "self"], 25 | // enforce newline at the end of file, with no multiple empty lines 26 | "eol-last": "error", 27 | // require or disallow spacing between function identifiers and their invocations 28 | "func-call-spacing": ["error", "never"], 29 | // require function names to match the name of the variable or property to which they are assigned 30 | "func-name-matching": "off", 31 | // require function expressions to have a name 32 | "func-names": "off", 33 | // enforces use of function declarations or expressions 34 | "func-style": ["error", "expression"], 35 | // disallow certain identifiers to prevent them being used 36 | "id-blacklist": "off", 37 | // this option enforces minimum and maximum identifier lengths (variable names, property names etc.) 38 | "id-length": "off", 39 | // require identifiers to match the provided regular expression 40 | "id-match": "off", 41 | // this option sets a specific tab width for your code 42 | indent: ["error", 2], 43 | // specify whether double or single quotes should be used in JSX attributes 44 | "jsx-quotes": ["error", "prefer-double"], 45 | // enforces spacing between keys and values in object literal properties 46 | "key-spacing": ["error", { beforeColon: false, 47 | afterColon: true }], 48 | // enforce spacing before and after keywords 49 | "keyword-spacing": ["error", { before: true, 50 | after: true }], 51 | // enforce position of line comments 52 | "line-comment-position": "off", 53 | // disallow mixed "LF" and "CRLF" as linebreaks 54 | "linebreak-style": ["off", "unix"], 55 | // enforces empty lines around comments 56 | "lines-around-comment": "off", 57 | // require or disallow newlines around directives 58 | "lines-around-directive": ["error", "always"], 59 | // specify the maximum depth that blocks can be nested 60 | "max-depth": ["error", 4], 61 | // specify the maximum length of a line in your program 62 | "max-len": ["error", 100, 2, { ignoreUrls: true, 63 | ignorePattern: "^\\s*var\\s.+=\\s*require\\s*\\(" }], 64 | // enforce a maximum number of lines per file 65 | "max-lines": "off", 66 | // specify the maximum depth callbacks can be nested 67 | "max-nested-callbacks": ["error", 3], 68 | // limits the number of parameters that can be used in the function declaration. 69 | "max-params": ["error", 3], 70 | // specify the maximum number of statement allowed in a function 71 | "max-statements": ["error", 15], 72 | // specify the maximum number of statements allowed per line 73 | "max-statements-per-line": "off", 74 | // enforce newlines between operands of ternary expressions 75 | "multiline-ternary": "off", 76 | // require a capital letter for constructors 77 | "new-cap": "error", 78 | // disallow the omission of parentheses when invoking a constructor with no arguments 79 | "new-parens": "error", 80 | // allow/disallow an empty newline after var statement 81 | "newline-after-var": "off", 82 | // require newline before return statement 83 | "newline-before-return": "off", 84 | // enforce newline after each call when chaining the calls 85 | "newline-per-chained-call": "off", 86 | // disallow use of the Array constructor 87 | "no-array-constructor": "error", 88 | // disallow use of bitwise operators 89 | "no-bitwise": "error", 90 | // disallow use of the continue statement 91 | "no-continue": "off", 92 | // disallow comments inline after code 93 | "no-inline-comments": "off", 94 | // disallow if as the only statement in an else block 95 | "no-lonely-if": "error", 96 | // disallow mixed binary operators 97 | "no-mixed-operators": "off", 98 | // disallow mixed spaces and tabs for indentation 99 | "no-mixed-spaces-and-tabs": "error", 100 | // disallow use of chained assignment expressions 101 | "no-multi-assign": "off", 102 | // disallow multiple empty lines 103 | "no-multiple-empty-lines": ["error", { max: 2 }], 104 | // disallow negated conditions 105 | "no-negated-condition": "off", 106 | // disallow nested ternary expressions 107 | "no-nested-ternary": "error", 108 | // disallow use of the Object constructor 109 | "no-new-object": "error", 110 | // disallow use of unary operators, ++ and -- 111 | "no-plusplus": "off", 112 | // disallow use of certain syntax in code 113 | "no-restricted-syntax": "off", 114 | // disallow all tabs 115 | "no-tabs": "off", 116 | // disallow the use of ternary operators 117 | "no-ternary": "off", 118 | // disallow trailing whitespace at the end of lines 119 | "no-trailing-spaces": "error", 120 | // disallow dangling underscores in identifiers 121 | "no-underscore-dangle": "off", 122 | // disallow the use of Boolean literals in conditional expressions 123 | "no-unneeded-ternary": "error", 124 | // disallow whitespace before properties 125 | "no-whitespace-before-property": "error", 126 | // enforce the location of single-line statements 127 | "nonblock-statement-body-position": ["error", "below"], 128 | // enforce consistent line breaks inside braces 129 | "object-curly-newline": "off", 130 | // require or disallow padding inside curly braces 131 | "object-curly-spacing": ["error", "always"], 132 | // enforce placing object properties on separate lines 133 | "object-property-newline": "error", 134 | // allow just one var statement per function 135 | "one-var": ["error", "never"], 136 | // require or disallow an newline around variable declarations 137 | "one-var-declaration-per-line": ["error", "initializations"], 138 | // require assignment operator shorthand where possible or prohibit it entirely 139 | "operator-assignment": ["error", "always"], 140 | // enforce operators to be placed before or after line breaks 141 | "operator-linebreak": ["error", "before"], 142 | // enforce padding within blocks 143 | "padded-blocks": ["error", "never"], 144 | // require quotes around object literal property names 145 | "quote-props": ["error", "as-needed", { keywords: true, 146 | numbers: true }], 147 | // specify whether double or single quotes should be used 148 | quotes: ["error", "double"], 149 | // Require JSDoc comment 150 | "require-jsdoc": "off", 151 | // require or disallow use of semicolons instead of ASI 152 | semi: "error", 153 | // enforce spacing before and after semicolons 154 | "semi-spacing": ["error", { before: false, 155 | after: true }], 156 | // require object keys to be sorted 157 | "sort-keys": "off", 158 | // sort variables within the same declaration block 159 | "sort-vars": "off", 160 | // require or disallow space before blocks 161 | "space-before-blocks": ["error", "always"], 162 | // require or disallow space before function opening parenthesis 163 | "space-before-function-paren": ["error", { anonymous: "always", 164 | named: "never" }], 165 | // require or disallow spaces inside parentheses 166 | "space-in-parens": ["error", "never"], 167 | // require spaces around operators 168 | "space-infix-ops": "error", 169 | // Require or disallow spaces before/after unary operators 170 | "space-unary-ops": ["error", { words: true, 171 | nonwords: false }], 172 | // require or disallow a space immediately following the // or /* in a comment 173 | "spaced-comment": ["error", "always", { exceptions: ["-", "=", "*"] }], 174 | // require or disallow spacing between template tags and their literals 175 | "template-tag-spacing": ["error", "always"], 176 | // require or disallow Unicode byte order mark (BOM) 177 | "unicode-bom": "off", 178 | // require regex literals to be wrapped in parentheses 179 | "wrap-regex": "error" 180 | } 181 | }; 182 | -------------------------------------------------------------------------------- /rules/eslint/variables/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // enforce or disallow variable initializations at definition 6 | "init-declarations": "off", 7 | // disallow the catch clause parameter name being the same as a variable in the outer scope 8 | "no-catch-shadow": "off", 9 | // disallow deletion of variables 10 | "no-delete-var": "off", 11 | // disallow labels that share a name with a variable 12 | "no-label-var": "off", 13 | // restrict usage of specified global variables 14 | "no-restricted-globals": "off", 15 | // disallow declaration of variables already declared in the outer scope 16 | "no-shadow": "off", 17 | // disallow shadowing of names such as arguments 18 | "no-shadow-restricted-names": "off", 19 | // disallow use of undeclared variables unless mentioned in a /*global */ block 20 | "no-undef": "off", 21 | // disallow use of undefined when initializing variables 22 | "no-undef-init": "off", 23 | // disallow use of undefined variable 24 | "no-undefined": "off", 25 | // disallow declaration of variables that are not used in the code 26 | "no-unused-vars": "off", 27 | // disallow use of variables before they are defined 28 | "no-use-before-define": "off" 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /rules/eslint/variables/on.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | rules: { 5 | // enforce or disallow variable initializations at definition 6 | "init-declarations": "off", 7 | // disallow the catch clause parameter name being the same as a variable in the outer scope 8 | "no-catch-shadow": "error", 9 | // disallow deletion of variables 10 | "no-delete-var": "error", 11 | // disallow labels that share a name with a variable 12 | "no-label-var": "error", 13 | // restrict usage of specified global variables 14 | "no-restricted-globals": "off", 15 | // disallow declaration of variables already declared in the outer scope 16 | "no-shadow": "error", 17 | // disallow shadowing of names such as arguments 18 | "no-shadow-restricted-names": "error", 19 | // disallow use of undeclared variables unless mentioned in a /*global */ block 20 | "no-undef": "error", 21 | // disallow use of undefined when initializing variables 22 | "no-undef-init": "error", 23 | // disallow use of undefined variable 24 | "no-undefined": "off", 25 | // disallow declaration of variables that are not used in the code 26 | "no-unused-vars": ["error", { vars: "all", 27 | args: "after-used" }], 28 | // disallow use of variables before they are defined 29 | "no-use-before-define": "error" 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /rules/filenames/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | plugins: [ 5 | "filenames" 6 | ], 7 | rules: { 8 | // Enforce dash-cased filenames 9 | "filenames/match-regex": "off", 10 | // Match the file name against the default exported value in the module 11 | "filenames/match-exported": "off", 12 | // Don't allow index.js files 13 | "filenames/no-index": "off" 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /rules/filenames/on.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | plugins: [ 5 | "filenames" 6 | ], 7 | rules: { 8 | // Enforce dash-cased filenames 9 | // `true` here means "don't enforce if `export default` exists in file" 10 | "filenames/match-regex": ["error", "^[a-z0-9\\-\\.]+$", false], 11 | // Match the file name against the default exported value in the module 12 | // Should set to `"error"` if last parameter above is `true`. 13 | "filenames/match-exported": "off", 14 | // Don't allow index.js files 15 | "filenames/no-index": "off" 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /rules/import/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | plugins: [ 5 | "import" 6 | ], 7 | rules: { 8 | // Ensure imports point to a file/module that can be resolved 9 | "import/no-unresolved": "off", 10 | // Ensure named imports correspond to a named export in the remote file 11 | "import/named": "off", 12 | // Ensure a default export is present, given a default import 13 | "import/default": "off", 14 | // Ensure imported namespaces contain dereferenced properties as they are dereferenced 15 | "import/namespace": "off", 16 | // Restrict which files can be imported in a given folder 17 | "import/no-restricted-paths": "off", 18 | // Report any invalid exports, i.e. re-export of the same name 19 | "import/export": "off", 20 | // Report use of exported name as identifier of default export 21 | "import/no-named-as-default": "off", 22 | // Report use of exported name as property of default export 23 | "import/no-named-as-default-member": "off", 24 | // Report imported names marked with @deprecated documentation tag 25 | "import/no-deprecated": "off", 26 | // Forbid the use of extraneous packages 27 | "import/no-extraneous-dependencies": "off", 28 | // Forbid the use of mutable exports with var or let 29 | "import/no-mutable-exports": "off", 30 | // Report CommonJS require calls and module.exports or exports.* 31 | "import/no-commonjs": "off", 32 | // Report AMD require and define calls. 33 | "import/no-amd": "off", 34 | // No Node.js builtin modules 35 | "import/no-nodejs-modules": "off", 36 | // Ensure all imports appear before other statements 37 | "import/imports-first": "off", 38 | // Report repeated import of the same module in multiple places 39 | "import/no-duplicates": "off", 40 | // Report namespace imports 41 | "import/no-namespace": "off", 42 | // Ensure consistent use of file extension within the import path 43 | "import/extensions": "off", 44 | // Enforce a convention in module import order 45 | "import/order": "off", 46 | // Enforce a newline after import statements 47 | "import/newline-after-import": "off", 48 | // Prefer a default export if module exports a single name 49 | "import/prefer-default-export": "off" 50 | } 51 | }; 52 | -------------------------------------------------------------------------------- /rules/import/on.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | plugins: [ 5 | "import" 6 | ], 7 | rules: { 8 | // Ensure imports point to a file/module that can be resolved 9 | "import/no-unresolved": ["error", { commonjs: true }], 10 | // Ensure named imports correspond to a named export in the remote file 11 | "import/named": "off", 12 | // Ensure a default export is present, given a default import 13 | "import/default": "off", 14 | // Ensure imported namespaces contain dereferenced properties as they are dereferenced 15 | "import/namespace": "off", 16 | // Restrict which files can be imported in a given folder 17 | "import/no-restricted-paths": "off", 18 | // Report any invalid exports, i.e. re-export of the same name 19 | "import/export": "error", 20 | // Report use of exported name as identifier of default export 21 | "import/no-named-as-default": "off", 22 | // Report use of exported name as property of default export 23 | "import/no-named-as-default-member": "off", 24 | // Report imported names marked with @deprecated documentation tag 25 | "import/no-deprecated": "off", 26 | // Forbid the use of extraneous packages 27 | "import/no-extraneous-dependencies": "off", 28 | // Forbid the use of mutable exports with var or let 29 | "import/no-mutable-exports": "error", 30 | // Report CommonJS require calls and module.exports or exports.* 31 | "import/no-commonjs": "off", 32 | // Report AMD require and define calls. 33 | "import/no-amd": "off", 34 | // No Node.js builtin modules 35 | "import/no-nodejs-modules": "off", 36 | // Ensure all imports appear before other statements 37 | "import/imports-first": "error", 38 | // Report repeated import of the same module in multiple places 39 | "import/no-duplicates": "error", 40 | // Report namespace imports 41 | "import/no-namespace": "off", 42 | // Ensure consistent use of file extension within the import path 43 | "import/extensions": "off", 44 | // Enforce a convention in module import order 45 | "import/order": "off", 46 | // Enforce a newline after import statements 47 | "import/newline-after-import": "off", 48 | // Prefer a default export if module exports a single name 49 | "import/prefer-default-export": "off" 50 | } 51 | }; 52 | -------------------------------------------------------------------------------- /rules/promise/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | plugins: [ 5 | "promise" 6 | ], 7 | rules: { 8 | // Return inside each then() to create readable and reusable Promise chains. 9 | "promise/always-return": "off", 10 | // Avoid creating new promises outside of utility libs (use pify instead) 11 | "promise/avoid-new": "off", 12 | // Enforces the use of catch() on un-returned promises. 13 | "promise/catch-or-return": "off", 14 | // Avoid calling cb() inside of a then() (use nodeify instead) 15 | "promise/no-callback-in-promise": "off", 16 | // In an ES5 environment, make sure to create a Promise constructor before using. 17 | "promise/no-native": "off", 18 | // Avoid nested then() or catch() statements 19 | "promise/no-nesting": "off", 20 | // Avoid using promises inside of callbacks 21 | "promise/no-promise-in-callback": "off", 22 | // Avoid wrapping values in Promise.resolve or Promise.reject when not needed. 23 | "promise/no-return-wrap": "off", 24 | // Enforce consistent param names when creating new promises. 25 | "promise/param-names": "off" 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /rules/promise/on.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | plugins: [ 5 | "promise" 6 | ], 7 | rules: { 8 | // Return inside each then() to create readable and reusable Promise chains. 9 | "promise/always-return": "error", 10 | // Avoid creating new promises outside of utility libs (use pify instead) 11 | "promise/avoid-new": "error", 12 | // Enforces the use of catch() on un-returned promises. 13 | "promise/catch-or-return": "error", 14 | // Avoid calling cb() inside of a then() (use nodeify instead) 15 | "promise/no-callback-in-promise": "error", 16 | // In an ES5 environment, make sure to create a Promise constructor before using. 17 | "promise/no-native": "off", 18 | // Avoid nested then() or catch() statements 19 | "promise/no-nesting": "error", 20 | // Avoid using promises inside of callbacks 21 | "promise/no-promise-in-callback": "error", 22 | // Avoid wrapping values in Promise.resolve or Promise.reject when not needed. 23 | "promise/no-return-wrap": "error", 24 | // Enforce consistent param names when creating new promises. 25 | "promise/param-names": "error" 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /rules/react/off.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | plugins: [ 5 | "react" 6 | ], 7 | rules: { 8 | // Prevent missing displayName in a React component definition 9 | "react/display-name": "off", 10 | // Forbid certain propTypes 11 | "react/forbid-prop-types": "off", 12 | // Prevent usage of dangerous JSX properties 13 | "react/no-danger": "off", 14 | // Prevent usage of deprecated methods 15 | "react/no-deprecated": "off", 16 | // Prevent usage of setState in componentDidMount 17 | "react/no-did-mount-set-state": "off", 18 | // Prevent usage of setState in componentDidUpdate 19 | "react/no-did-update-set-state": "off", 20 | // Prevent direct mutation of this.state 21 | "react/no-direct-mutation-state": "off", 22 | // Prevent usage of findDOMNode 23 | "react/no-find-dom-node": "off", 24 | // Prevent usage of isMounted 25 | "react/no-is-mounted": "off", 26 | // Prevent multiple component definition per file 27 | "react/no-multi-comp": "off", 28 | // Prevent usage of the return value of React.render 29 | "react/no-render-return-value": "off", 30 | // Prevent usage of setState 31 | "react/no-set-state": "off", 32 | // Prevent using string references in ref attribute. 33 | "react/no-string-refs": "off", 34 | // Prevent usage of unknown DOM property 35 | "react/no-unknown-property": "off", 36 | // Enforce ES5 or ES6 class for React Components 37 | "react/prefer-es6-class": "off", 38 | // Enforce stateless React Components to be written as a pure function 39 | "react/prefer-stateless-function": "off", 40 | // Prevent missing props validation in a React component definition 41 | "react/prop-types": "off", 42 | // Prevent missing React when using JSX 43 | "react/react-in-jsx-scope": "off", 44 | // Restrict file extensions that may be required 45 | "react/require-extension": "off", 46 | // Enforce React components to have a shouldComponentUpdate method 47 | "react/require-optimization": "off", 48 | // Enforce ES5 or ES6 class for returning value in render function 49 | "react/require-render-return": "off", 50 | // Prevent extra closing tags for components without children 51 | "react/self-closing-comp": "off", 52 | // Enforce component methods order 53 | "react/sort-comp": "off", 54 | // Enforce propTypes declarations alphabetical sorting 55 | "react/sort-prop-types": "off", 56 | 57 | // ======================================================================== 58 | // JSX Specific Rules 59 | // ======================================================================== 60 | 61 | // Enforce boolean attributes notation in JSX 62 | "react/jsx-boolean-value": "off", 63 | // Validate closing bracket location in JSX 64 | "react/jsx-closing-bracket-location": "off", 65 | // Enforce or disallow spaces inside of curly braces in JSX attributes 66 | "react/jsx-curly-spacing": "off", 67 | // Enforce or disallow spaces around equal signs in JSX attributes (fixable) 68 | "react/jsx-equals-spacing": "off", 69 | // Restrict file extensions that may contain JSX 70 | "react/jsx-filename-extension": "off", 71 | // Enforce position of the first prop in JSX 72 | "react/jsx-first-prop-new-line": "off", 73 | // Enforce event handler naming conventions in JSX 74 | "react/jsx-handler-names": "off", 75 | // Validate JSX indentation 76 | "react/jsx-indent": "off", 77 | // Validate props indentation in JSX 78 | "react/jsx-indent-props": "off", 79 | // Validate JSX has key prop when in array or iterator 80 | "react/jsx-key": "off", 81 | // Limit maximum of props on a single line in JSX 82 | "react/jsx-max-props-per-line": "off", 83 | // Prevent usage of .bind() and arrow functions in JSX props 84 | "react/jsx-no-bind": "off", 85 | // Prevent comments from being inserted as text nodes 86 | "react/jsx-no-comment-textnodes": "off", 87 | // Prevent duplicate props in JSX 88 | "react/jsx-no-duplicate-props": "off", 89 | // Prevent usage of unwrapped JSX strings 90 | "react/jsx-no-literals": "off", 91 | // Prevent usage of unsafe target='_blank' 92 | "react/jsx-no-target-blank": "off", 93 | // Disallow undeclared variables in JSX 94 | "react/jsx-no-undef": "off", 95 | // Enforce PascalCase for user-defined JSX components 96 | "react/jsx-pascal-case": "off", 97 | // Enforce props alphabetical sorting 98 | "react/jsx-sort-props": "off", 99 | // Validate spacing before closing bracket in JSX (fixable) 100 | "react/jsx-space-before-closing": "off", 101 | // Prevent React to be incorrectly marked as unused 102 | "react/jsx-uses-react": "off", 103 | // Prevent variables used in JSX to be incorrectly marked as unused 104 | "react/jsx-uses-vars": "off", 105 | // Prevent missing parentheses around multilines JSX 106 | "react/jsx-wrap-multilines": "off" 107 | } 108 | }; 109 | -------------------------------------------------------------------------------- /rules/react/on.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | plugins: [ 5 | "react" 6 | ], 7 | rules: { 8 | // Prevent missing displayName in a React component definition 9 | "react/display-name": "off", 10 | // Forbid certain propTypes 11 | "react/forbid-prop-types": "off", 12 | // Prevent usage of dangerous JSX properties 13 | "react/no-danger": "off", 14 | // Prevent usage of deprecated methods 15 | "react/no-deprecated": "error", 16 | // Prevent usage of setState in componentDidMount 17 | "react/no-did-mount-set-state": "error", 18 | // Prevent usage of setState in componentDidUpdate 19 | "react/no-did-update-set-state": "error", 20 | // Prevent direct mutation of this.state 21 | "react/no-direct-mutation-state": "error", 22 | // Prevent usage of findDOMNode 23 | "react/no-find-dom-node": "warn", 24 | // Prevent usage of isMounted 25 | "react/no-is-mounted": "error", 26 | // Prevent multiple component definition per file 27 | "react/no-multi-comp": "error", 28 | // Prevent usage of the return value of React.render 29 | "react/no-render-return-value": "off", 30 | // Prevent usage of setState 31 | "react/no-set-state": "off", 32 | // Prevent using string references in ref attribute. 33 | "react/no-string-refs": "error", 34 | // Prevent usage of unknown DOM property 35 | "react/no-unknown-property": "error", 36 | // Enforce ES5 or ES6 class for React Components 37 | "react/prefer-es6-class": "error", 38 | // Enforce stateless React Components to be written as a pure function 39 | "react/prefer-stateless-function": "off", 40 | // Prevent missing props validation in a React component definition 41 | "react/prop-types": "error", 42 | // Prevent missing React when using JSX 43 | "react/react-in-jsx-scope": "error", 44 | // Restrict file extensions that may be required 45 | "react/require-extension": "off", 46 | // Enforce React components to have a shouldComponentUpdate method 47 | "react/require-optimization": "off", 48 | // Enforce ES5 or ES6 class for returning value in render function 49 | "react/require-render-return": "off", 50 | // Prevent extra closing tags for components without children 51 | "react/self-closing-comp": "error", 52 | // Enforce component methods order 53 | "react/sort-comp": "error", 54 | // Enforce propTypes declarations alphabetical sorting 55 | "react/sort-prop-types": "error", 56 | 57 | // ======================================================================== 58 | // JSX Specific Rules 59 | // ======================================================================== 60 | 61 | // Enforce boolean attributes notation in JSX 62 | "react/jsx-boolean-value": "error", 63 | // Validate closing bracket location in JSX 64 | "react/jsx-closing-bracket-location": ["error", "tag-aligned"], 65 | // Enforce or disallow spaces inside of curly braces in JSX attributes 66 | "react/jsx-curly-spacing": "off", 67 | // Enforce or disallow spaces around equal signs in JSX attributes (fixable) 68 | "react/jsx-equals-spacing": "off", 69 | // Restrict file extensions that may contain JSX 70 | "react/jsx-filename-extension": "off", 71 | // Enforce position of the first prop in JSX 72 | "react/jsx-first-prop-new-line": "off", 73 | // Enforce event handler naming conventions in JSX 74 | "react/jsx-handler-names": "warn", 75 | // Validate JSX indentation 76 | "react/jsx-indent": "off", 77 | // Validate props indentation in JSX 78 | "react/jsx-indent-props": ["error", 2], 79 | // Validate JSX has key prop when in array or iterator 80 | "react/jsx-key": "error", 81 | // Limit maximum of props on a single line in JSX 82 | "react/jsx-max-props-per-line": "off", 83 | // Prevent usage of .bind() and arrow functions in JSX props 84 | "react/jsx-no-bind": "off", 85 | // Prevent comments from being inserted as text nodes 86 | "react/jsx-no-comment-textnodes": "off", 87 | // Prevent duplicate props in JSX 88 | "react/jsx-no-duplicate-props": "off", 89 | // Prevent usage of unwrapped JSX strings 90 | "react/jsx-no-literals": "off", 91 | // Prevent usage of unsafe target='_blank' 92 | "react/jsx-no-target-blank": "off", 93 | // Disallow undeclared variables in JSX 94 | "react/jsx-no-undef": "error", 95 | // Enforce PascalCase for user-defined JSX components 96 | "react/jsx-pascal-case": "error", 97 | // Enforce propTypes declarations alphabetical sorting 98 | "react/jsx-sort-props": "off", 99 | // Validate spacing before closing bracket in JSX (fixable) 100 | "react/jsx-space-before-closing": "off", 101 | // Prevent React to be incorrectly marked as unused 102 | "react/jsx-uses-react": "error", 103 | // Prevent variables used in JSX to be incorrectly marked as unused 104 | "react/jsx-uses-vars": "error", 105 | // Prevent missing parentheses around multilines JSX 106 | "react/jsx-wrap-multilines": "error" 107 | } 108 | }; 109 | --------------------------------------------------------------------------------