eslint-config-nutshell
Advanced tools
Comparing version 5.0.0 to 6.0.0
# Changes | ||
## 6.0.0 | ||
- Enable lots of new rules | ||
- Bump peer dependencies | ||
- See https://github.com/nutshellcrm/eslint-config-nutshell/pull/12 for full details. | ||
## 5.0.0 | ||
@@ -4,0 +9,0 @@ - Update eslint-plugin-react to ^6.0.0 |
@@ -14,3 +14,4 @@ 'use strict'; | ||
'eslint-config-nutshell/rules/import', | ||
'eslint-config-nutshell/rules/variables', | ||
], | ||
}; |
{ | ||
"name": "eslint-config-nutshell", | ||
"version": "5.0.0", | ||
"version": "6.0.0", | ||
"description": "ESLint sharable config for Nutshell Javascript style guide", | ||
@@ -8,3 +8,4 @@ "main": "index.js", | ||
"test": "npm run lint -s", | ||
"lint": "eslint ." | ||
"lint": "eslint .", | ||
"find-rules": "eslint-find-rules --unused" | ||
}, | ||
@@ -29,14 +30,15 @@ "repository": { | ||
"eslint": "2.x - 3.x", | ||
"eslint-plugin-babel": "^3.0.0", | ||
"eslint-plugin-react": "^6.0.0", | ||
"eslint-plugin-import": "^1.0.0" | ||
"eslint-plugin-babel": "3.x - 4.x", | ||
"eslint-plugin-import": "^2.0.0", | ||
"eslint-plugin-react": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"babel-eslint": "^6.0.2", | ||
"eslint": "^2.7.0", | ||
"babel-eslint": "^7.1.1", | ||
"eslint": "^3.12.2", | ||
"eslint-config-nutshell": "file:.", | ||
"eslint-plugin-babel": "^3.1.0", | ||
"eslint-plugin-import": "^1.4.0", | ||
"eslint-find-rules": "^1.14.3", | ||
"eslint-plugin-babel": "^4.0.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-react": "^6.1.0" | ||
} | ||
} |
@@ -5,15 +5,57 @@ 'use strict'; | ||
'rules': { | ||
// Enforce return statements in callbacks of array methods | ||
'array-callback-return' : [2], | ||
// Enforce that class methods utilize this | ||
'class-methods-use-this' : [2], | ||
// Specify curly brace conventions for all control statements | ||
'curly' : [2, 'multi-line'], | ||
'curly' : [2, 'multi-line'], | ||
// Require dot Nntation | ||
'dot-notation' : [2], | ||
// Require === and !== | ||
'eqeqeq' : [2], | ||
// Require Guarding for-in | ||
'guard-for-in' : [2], | ||
// Disallow the use of `alert`, `confirm`, and `prompt` | ||
'no-alert' : [2], | ||
// Disallow Use of caller/callee | ||
'no-caller' : [2], | ||
// Disallow null comparisons | ||
'no-eq-null' : [2], | ||
// Disallow eval() | ||
'no-eval' : [2], | ||
// Disallow unnecessary function binding | ||
'no-extra-bind' : [2], | ||
// Disallow Floating Decimals | ||
'no-floating-decimal' : [2], | ||
// Disallow the type conversions with shorter notations | ||
'no-implicit-coercion': [2], | ||
'no-implicit-coercion' : [2], | ||
// Disallow Implied eval() | ||
'no-implied-eval' : [2], | ||
// Disallow Functions in Loops | ||
'no-loop-func' : [2], | ||
// Disallow use of multiple spaces | ||
'no-multi-spaces' : [2], | ||
'no-multi-spaces' : [2], | ||
// Disallow new operators with the Function object | ||
'no-new-func' : [2], | ||
// Disallow new operators with the String, Number, and Boolean objects | ||
'no-new-wrappers' : [2], | ||
// Disallow reassignment of function parameters | ||
'no-param-reassign' : [2], | ||
'no-param-reassign' : [2], | ||
// Disallow assignment operators in return statements | ||
'no-return-assign' : [2], | ||
// Disallow comparisons where both sides are exactly the same | ||
'no-self-compare' : [2], | ||
'no-self-compare' : [2], | ||
// Disallow Use of the Comma Operator | ||
'no-sequences' : [2], | ||
// Disallow usage of expressions in statement position | ||
'no-throw-literal' : [2], | ||
'no-throw-literal' : [2], | ||
// Disallow unmodified conditions of loops | ||
'no-unmodified-loop-condition': [2], | ||
// Disallow unnecessary concatenation of strings | ||
'no-useless-concat' : [2], | ||
// Disallow unnecessary escape characters | ||
'no-useless-escape' : [2], | ||
// Disallow redundant return statements | ||
'no-useless-return' : [2], | ||
}, | ||
}; |
@@ -5,5 +5,9 @@ 'use strict'; | ||
'rules': { | ||
// Enforce trailing commas in multiline object literals | ||
'comma-dangle': [2, 'always-multiline'], | ||
// Disallow template literal placeholder syntax in regular strings | ||
'no-template-curly-in-string': [2], | ||
// Disallow negating the left operand of relational operators | ||
'no-unsafe-negation' : [2], | ||
// Enforce valid JSDoc comments | ||
'valid-jsdoc' : [2], | ||
}, | ||
}; |
@@ -11,5 +11,29 @@ 'use strict'; | ||
'rules': { | ||
// Require parentheses around arrow function arguments as-needed | ||
'arrow-parens' : [2, 'as-needed'], | ||
// Require space before/after arrow function’s arrow | ||
'arrow-spacing' : [2], | ||
// Disallow use of this/super before calling super() in constructors | ||
'no-this-before-super' : [2], | ||
// Disallow unnecessary computed property keys on objects | ||
'no-useless-computed-key': [2], | ||
// Disallow unnecessary constructors | ||
'no-useless-constructor' : [2], | ||
// Require let or const instead of var | ||
'no-var': [2], | ||
'no-var' : [2], | ||
// Require arrow functions as callbacks | ||
'prefer-arrow-callback' : [2], | ||
// Require const declarations for variables that are never reassigned after declared | ||
'prefer-const' : [2], | ||
// Require spread operators instead of .apply() | ||
'prefer-spread' : [2], | ||
// Require template literals instead of string concatenation | ||
'prefer-template' : [2], | ||
// Require rest parameters instead of arguments | ||
'prefer-rest-params' : [2], | ||
// Disallow spacing between rest and spread operators and their expressions | ||
'rest-spread-spacing' : [2, 'never'], | ||
// Disallow spacing around embedded expressions of template strings | ||
'template-curly-spacing' : [2, 'never'], | ||
}, | ||
}; |
@@ -8,12 +8,54 @@ 'use strict'; | ||
'rules': { | ||
// Ensure imports point to a file/module that can be resolved | ||
'import/no-unresolved' : [2], | ||
// Ensure a default export is present, given a default import | ||
'import/default' : [2], | ||
// Report funny business with exports, like repeated exports of names or defaults | ||
'import/export' : [2], | ||
// Ensure consistent use of file extension within the import path | ||
'import/extensions' : [2, 'never'], | ||
// Report any imports that come after non-import statements | ||
'import/imports-first' : [2], | ||
// Ensure named imports correspond to a named export in the remote file | ||
'import/named' : [2], | ||
'import/named' : [2], | ||
// Ensure imported namespaces contain dereferenced properties as they are dereferenced | ||
'import/namespace' : [2], | ||
// Ensure a default export is present, given a default import | ||
'import/default' : [2], | ||
'import/namespace' : [2], | ||
// Enforce having an empty line after the last top-level import statement or require call | ||
'import/newline-after-import' : [2], | ||
// Forbid import of modules using absolute paths | ||
'import/no-absolute-path' : [2], | ||
// Report require([array], ...) and define([array], ...) function calls at the module scope. | ||
'import/no-amd' : [2], | ||
// Report require([string]) function calls. | ||
'import/no-commonjs' : [2], | ||
// Report if a resolved path is imported more than once | ||
'import/no-duplicates' : [2], | ||
// Forbid require() calls with expressions | ||
'import/no-dynamic-require' : [2], | ||
// Forbid the import of external modules that are not declared in the package.json | ||
'import/no-extraneous-dependencies': [2], | ||
// Forbid the use of mutable exports with var or let. | ||
'import/no-mutable-exports' : [2], | ||
// Report use of an exported name as a property on the default export | ||
'import/no-named-as-default-member': [2], | ||
// Report use of exported name as identifier of default export | ||
'import/no-named-as-default': [2], | ||
'import/no-named-as-default' : [2], | ||
// Report use of a default export as a locally named import | ||
'import/no-named-default' : [2], | ||
// Forbid the use of Node.js builtin modules | ||
'import/no-nodejs-modules' : [2], | ||
// Ensure imports point to a file/module that can be resolved | ||
'import/no-unresolved' : [2], | ||
// Forbid Webpack loader syntax in imports | ||
'import/no-webpack-loader-syntax' : [2], | ||
// Enforce a convention in the order of require() / import statements | ||
'import/order' : [2, {'groups': ['builtin', ['external', 'internal'], 'parent', 'sibling', 'index']}], | ||
// Warn if a module could be mistakenly parsed as a script | ||
'import/unambiguous' : [2], | ||
// --- Disabled Rules --- | ||
'import/max-dependencies' : [0], | ||
'import/no-deprecated' : [0], | ||
'import/no-internal-modules' : [0], | ||
'import/no-namespace' : [0], | ||
'import/no-restricted-paths' : [0], | ||
'import/no-unassigned-import' : [0], | ||
'import/prefer-default-export' : [0], | ||
}, | ||
@@ -20,0 +62,0 @@ 'settings': { |
@@ -12,8 +12,8 @@ 'use strict'; | ||
'react': { | ||
'version': '0.14', | ||
'version': '15.0', | ||
}, | ||
}, | ||
'rules': { | ||
// Prevent variables used in JSX to be incorrectly marked as unused | ||
'react/jsx-uses-vars' : [2], | ||
// Forbid vague propTypes | ||
// 'react/forbid-prop-types' : [2, {'forbid': ['any']}], | ||
// Enforce boolean attributes notation in JSX | ||
@@ -25,12 +25,48 @@ 'react/jsx-boolean-value' : [2, 'always'], | ||
'react/jsx-curly-spacing' : [2, 'never'], | ||
// Disallow spaces around equal signs in JSX attributes | ||
'react/jsx-equals-spacing' : [2], | ||
// Ensure correct position of the first property | ||
'react/jsx-first-prop-new-line' : [2, 'multiline'], | ||
// Enforce handler naming convention | ||
'react/jsx-handler-names' : [2], | ||
// Validate props indentation in JSX | ||
'react/jsx-indent-props' : [2, 4], | ||
// Validate JSX indentation | ||
'react/jsx-indent' : [2, 4], | ||
// Detect missing key prop | ||
'react/jsx-key' : [2], | ||
// Limit maximum of props on a single line in JSX | ||
'react/jsx-max-props-per-line' : [2, {'maximum': 3}], | ||
// Prevent comments from being inserted as text nodes | ||
'react/jsx-no-comment-textnodes' : [2], | ||
// Prevent duplicate props in JSX | ||
'react/jsx-no-duplicate-props' : [2], | ||
// Prevent usage of unsafe target='_blank' | ||
'react/jsx-no-target-blank' : [2], | ||
// Disallow undeclared variables in JSX | ||
'react/jsx-no-undef' : [2], | ||
// Enforce PascalCase for user-defined JSX components | ||
'react/jsx-pascal-case' : [2], | ||
// Enforce props alphabetical sorting | ||
'react/jsx-sort-props' : [2, {'callbacksLast': true, 'ignoreCase': true, 'shortHandFirst': true}], | ||
// Validate spacing before closing bracket in JSX | ||
'react/jsx-space-before-closing' : [2, 'always'], | ||
// Validate whitespace in and around the JSX opening and closing brackets | ||
'react/jsx-tag-spacing' : [2], | ||
// Prevent React to be incorrectly marked as unused | ||
'react/jsx-uses-react' : [2], | ||
// Prevent variables used in JSX to be incorrectly marked as unused | ||
'react/jsx-uses-vars' : [2], | ||
// Prevent missing parentheses around multilines JSX | ||
'react/jsx-wrap-multilines' : [2], | ||
// Prevent usage of Array index in keys | ||
'react/no-array-index-key' : [2], | ||
// Prevent passing of children as props | ||
'react/no-children-prop' : [2], | ||
// Prevent problem with children and props.dangerouslySetInnerHTML | ||
'react/no-danger-with-children' : [2], | ||
// Prevent usage of dangerous JSX properties | ||
'react/no-danger' : [2], | ||
// Prevent use of deprecated methods | ||
'react/no-deprecated' : [2], | ||
// Prevent usage of setState in componentDidMount | ||
@@ -42,2 +78,14 @@ 'react/no-did-mount-set-state' : [2], | ||
'react/no-direct-mutation-state' : [2], | ||
// Prevent usage of findDOMNode | ||
'react/no-find-dom-node' : [2], | ||
// Prevent usage of isMounted | ||
'react/no-is-mounted' : [2], | ||
// | ||
'react/no-multi-comp' : [2], | ||
// Prevent usage of the return value of React.render | ||
'react/no-render-return-value' : [2], | ||
// Prevent using string references | ||
'react/no-string-refs' : [2], | ||
// Prevent invalid characters from appearing in markup | ||
'react/no-unescaped-entities' : [2], | ||
// Prevent usage of unknown DOM property | ||
@@ -49,11 +97,25 @@ 'react/no-unknown-property' : [2], | ||
'react/prop-types' : [2], | ||
// Prevent missing React when using JSX | ||
'react/react-in-jsx-scope' : [2], | ||
// Enforce a defaultProps definition for every prop that is not a required prop | ||
'react/require-default-props' : [2], | ||
// Enforce ES5 or ES6 class for returning value in render function | ||
'react/require-render-return' : [2], | ||
// Prevent extra closing tags for components without children | ||
'react/self-closing-comp' : [2, {html: false}], | ||
// Prevent missing parentheses around multilines JSX | ||
'react/jsx-wrap-multilines' : [2], | ||
// Enforce handler naming convention | ||
'react/jsx-handler-names' : [2], | ||
// Prevent use of deprecated methods | ||
'react/no-deprecated' : [2], | ||
'react/self-closing-comp' : [2, {'html': false}], | ||
// Enforce style prop value being an object | ||
'react/style-prop-object' : [2], | ||
// --- Disabled Rules --- | ||
'react/display-name' : [0], | ||
'react/forbid-component-props' : [0], | ||
'react/jsx-filename-extension' : [0], | ||
'react/jsx-no-bind' : [0], | ||
'react/jsx-no-literals' : [0], | ||
'react/jsx-no-set-state' : [0], | ||
'react/no-unused-prop-types' : [0], // Waiting for the problems mentioned in https://github.com/yannickcr/eslint-plugin-react/issues/976#issuecomment-268995092 to be addressed | ||
'react/prefer-stateless-function' : [0], | ||
'react/require-optimization' : [0], | ||
'react/sort-comp' : [0], // Would like to enable, but is a big job | ||
'react/sort-prop-types' : [0], | ||
}, | ||
}; |
@@ -5,53 +5,83 @@ 'use strict'; | ||
'rules': { | ||
// Enforce consistent spacing inside array brackets | ||
'array-bracket-spacing' : [2, 'never'], | ||
// Enforce spaces inside of single line blocks | ||
'block-spacing' : [2, 'always'], | ||
'block-spacing' : [2, 'always'], | ||
// Enforce one true brace style | ||
'brace-style' : [2, '1tbs', {'allowSingleLine': true }], | ||
'brace-style' : [2, '1tbs', {'allowSingleLine': true }], | ||
// Enforce capitalization of the first letter of a comment | ||
'capitalized-comments' : [2, 'always', {'ignoreConsecutiveComments': true}], | ||
// Enforce trailing commas in multiline object literals | ||
'comma-dangle' : [2, 'always-multiline'], | ||
// Enforce spacing after comma | ||
'comma-spacing' : [2, {'before': false, 'after': true}], | ||
'comma-spacing' : [2, {'before': false, 'after': true}], | ||
// Disallow spaces inside of computed properties | ||
'computed-property-spacing' : [2, 'never'], | ||
// Enforce consistent naming when capturing the current execution context | ||
'consistent-this' : [2, 'self'], | ||
'consistent-this' : [2, 'self'], | ||
// Enforce newline at the end of file, with no multiple empty lines | ||
'eol-last' : [2], | ||
'eol-last' : [2], | ||
// Disallow spacing between function identifiers and their invocations | ||
'func-call-spacing' : [2], | ||
// Enforce four space indent width for your code | ||
'indent' : [2, 4], | ||
'indent' : [2, 4], | ||
// Enforce spacing between keys and values in object literal properties | ||
'key-spacing' : [2, {'beforeColon': false, 'afterColon': true}], | ||
'key-spacing' : [2, {'beforeColon': false, 'afterColon': true}], | ||
// Enforce spacing around keywords | ||
'keyword-spacing' : [2], | ||
'keyword-spacing' : [2], | ||
// Disallow mixed 'LF' and 'CRLF' as linebreaks | ||
'linebreak-style' : [2, 'unix'], | ||
'linebreak-style' : [2, 'unix'], | ||
// Enforce a maximum number of statements allowed per line | ||
'max-statements-per-line' : [2, {'max': 1}], | ||
// Require an empty line before return statements | ||
'newline-before-return' : [2], | ||
// Require a newline after each call in a method chain | ||
'newline-per-chained-call' : [2, {'ignoreChainWithDepth': 3}], | ||
// Disallow Array constructors | ||
'no-array-constructor' : [2], | ||
// Disallow use of the continue statement | ||
'no-continue' : [2], | ||
'no-continue' : [2], | ||
// Disallow if as the only statement in an else block | ||
'no-lonely-if' : [2], | ||
'no-lonely-if' : [2], | ||
// disallow multiple empty lines | ||
'no-multiple-empty-lines' : [2], | ||
'no-multiple-empty-lines' : [2], | ||
// Disallow nested ternary expressions | ||
'no-nested-ternary' : [2], | ||
'no-nested-ternary' : [2], | ||
// Disallow Object constructors | ||
'no-new-object' : [2], | ||
// Disallow space between function identifier and application | ||
'no-spaced-func' : [2], | ||
'no-spaced-func' : [2], | ||
// Disallow spaces at the ends of lines | ||
'no-trailing-spaces' : [2], | ||
// Disallow the use of Boolean literals in conditional expressions | ||
'no-unneeded-ternary' : [2], | ||
'no-unneeded-ternary' : [2], | ||
// Disallow whitespace before properties | ||
'no-whitespace-before-property': [2], | ||
// Enforce consistent spacing inside braces | ||
'object-curly-spacing' : [2], | ||
// Require newlines around variable declarations | ||
'one-var-declaration-per-line' : [2], | ||
// Enforce consistent linebreak style for operators | ||
'operator-linebreak' : [2, 'before'], | ||
// Enforce padding within blocks | ||
'padded-blocks' : [2, 'never'], | ||
'padded-blocks' : [2, 'never'], | ||
// Require quotes around object literal property names | ||
'quote-props' : [2, 'as-needed', {'keywords': true}], | ||
'quote-props' : [2, 'as-needed', {'keywords': true}], | ||
// Specify use of single quotes | ||
'quotes' : [2, 'single'], | ||
'quotes' : [2, 'single'], | ||
// Enforce spacing after semicolons | ||
'semi-spacing' : [2, {'before': false, 'after': true}], | ||
'semi-spacing' : [2, {'before': false, 'after': true}], | ||
// Require use of semicolons instead of ASI | ||
'semi' : [2, 'always'], | ||
'semi' : [2, 'always'], | ||
// Require space before blocks | ||
'space-before-blocks' : [2], | ||
'space-before-blocks' : [2], | ||
// Disallow space before function opening parenthesis | ||
'space-before-function-paren': [2, 'never'], | ||
'space-before-function-paren' : [2, 'never'], | ||
// Require spaces around infix operators | ||
'space-infix-ops' : [2], | ||
'space-infix-ops' : [2], | ||
// Disallow spaces before/after unary operators | ||
'space-unary-ops' : [2], | ||
// Disallow spaces at the ends of lines | ||
'no-trailing-spaces' : [2], | ||
'space-unary-ops' : [2], | ||
// Enforce consistent spacing after the // or /* in a comment | ||
'spaced-comment' : [2, 'always', {'block': {'exceptions': ['-'], 'balanced': true}}], | ||
}, | ||
}; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
65124
18
417
7
1