Socket
Socket
Sign inDemoInstall

eslint-config-airbnb-base

Package Overview
Dependencies
249
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 12.1.0 to 13.0.0

LICENSE.md

34

CHANGELOG.md

@@ -0,1 +1,35 @@

13.0.0 / 2018-06-21
==================
- [breaking] order of import statements is ignored for unassigned imports (#1782)
- [breaking] enable `import/no-cycle`: warn on cyclical dependencies (#1779)
- [breaking] Change import/no-self-import from "off" to "error" (#1770)
- [breaking] Update `object-curly-newline` to match eslint 4.18.0 (#1761)
- [breaking] enable `no-useless-path-segments` (#1743)
- [breaking] Prevent line breaks before and after `=` (#1710)
- [breaking] Add .mjs extension support (#1634)
- [breaking] enable `implicit-arrow-linebreak`
- [breaking] Enables `nonblock-statement-body-position` rule and adds link to guide (#1618)
- [breaking] `no-mixed-operators`: only warn on `**` and `%` mixed with arithmetic operators; removes violation against mixing common math operators. (#1611)
- [breaking] `import/named`: enable
- [breaking] `lines-between-class-members`: set to “always”
- [breaking] `no-else-return`: disallow else-if (#1595)
- [breaking] Enables eslint rule for operator-linebreak
- [new] Adds config entry point with only whitespace rules enabled (#1749, #1751)
- [minor] only allow one newline at the end (#1794)
- [patch] Adjust imports for vue-cli (#1809)
- [patch] Allow devDependencies for `foo_spec.js` naming style (#1732)
- [patch] `function-paren-newline`: change to "consistent"
- [patch] avoid `__mocks__` `no-extraneous-dependencies` check (#1772)
- [patch] Include 'accumulator' exception for `no-param-reassign` (#1768)
- [patch] Set import/extensions to ignorePackages (#1652)
- [patch] properly ignore indentation on jsx
- [patch] `array-callback-return`: enable `allowImplicit` option (#1668)
- [deps] update `eslint`, `eslint-plugin-import`
- [dev deps] update `babel-preset-airbnb`, `tape`, `eslint-find-rules`
- [meta] add ES2015-2018 in npm package keywords (#1587)
- [meta] Add licenses to sub packages (#1746)
- [docs] add `npx` shortcut (#1694)
- [docs] Use HTTPS for links to ESLint documentation (#1628)
- [tests] ensure all entry points parse
12.1.0 / 2017-10-16

@@ -2,0 +36,0 @@ ==================

27

package.json
{
"name": "eslint-config-airbnb-base",
"version": "12.1.0",
"version": "13.0.0",
"description": "Airbnb's base JS ESLint config, following our styleguide",

@@ -9,2 +9,3 @@ "main": "index.js",

"lint": "eslint --report-unused-disable-directives .",
"pretests-only": "node ./test/requires",
"tests-only": "babel-tape-runner ./test/test-*.js",

@@ -28,3 +29,7 @@ "prepublish": "(in-install || eslint-find-rules --unused) && (not-in-publish || npm test) && safe-publish-latest",

"javascript",
"styleguide"
"styleguide",
"es2015",
"es2016",
"es2017",
"es2018"
],

@@ -53,15 +58,15 @@ "author": "Jake Teton-Landis (https://twitter.com/@jitl)",

"devDependencies": {
"babel-preset-airbnb": "^2.4.0",
"babel-preset-airbnb": "^2.5.1",
"babel-tape-runner": "^2.0.1",
"editorconfig-tools": "^0.1.1",
"eslint": "^4.9.0",
"eslint-find-rules": "^3.1.1",
"eslint-plugin-import": "^2.7.0",
"eslint": "^4.19.1",
"eslint-find-rules": "^3.2.3",
"eslint-plugin-import": "^2.12.0",
"in-publish": "^2.0.0",
"safe-publish-latest": "^1.1.1",
"tape": "^4.8.0"
"tape": "^4.9.1"
},
"peerDependencies": {
"eslint": "^4.9.0",
"eslint-plugin-import": "^2.7.0"
"eslint": "^4.19.1",
"eslint-plugin-import": "^2.12.0"
},

@@ -72,4 +77,6 @@ "engines": {

"dependencies": {
"eslint-restricted-globals": "^0.1.1"
"eslint-restricted-globals": "^0.1.1",
"object.assign": "^4.1.0",
"object.entries": "^1.0.4"
}
}

@@ -23,4 +23,11 @@ # eslint-config-airbnb-base

Linux/OSX users can run
If using **npm 5+**, use this shortcut
```sh
npx install-peerdeps --dev eslint-config-airbnb-base
```
If using **npm < 5**, Linux/OSX users can run
```sh
(

@@ -38,3 +45,3 @@ export PKG=eslint-config-airbnb-base;

Windows users can either install all the peer dependencies manually, or use the [install-peerdeps](https://github.com/nathanhleung/install-peerdeps) cli tool.
If using **npm < 5**, Windows users can either install all the peer dependencies manually, or use the [install-peerdeps](https://github.com/nathanhleung/install-peerdeps) cli tool.

@@ -80,4 +87,8 @@ ```sh

See [Airbnb's overarching ESLint config](https://npmjs.com/eslint-config-airbnb), [Airbnb's Javascript styleguide](https://github.com/airbnb/javascript), and the [ESlint config docs](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) for more information.
See [Airbnb's overarching ESLint config](https://npmjs.com/eslint-config-airbnb), [Airbnb's Javascript styleguide](https://github.com/airbnb/javascript), and the [ESlint config docs](https://eslint.org/docs/user-guide/configuring#extending-configuration-files) for more information.
### eslint-config-airbnb-base/whitespace
This entry point that only warns on whitespace rules and sets all other rules to warnings. View the list of whitespace rules [here](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/whitespace.js).
## Improving this config

@@ -84,0 +95,0 @@

@@ -7,4 +7,4 @@ module.exports = {

// enforces return statements in callbacks of array's methods
// http://eslint.org/docs/rules/array-callback-return
'array-callback-return': 'error',
// https://eslint.org/docs/rules/array-callback-return
'array-callback-return': ['error', { allowImplicit: true }],

@@ -18,3 +18,3 @@ // treat var statements as if they were block scoped

// enforce that class methods use "this"
// http://eslint.org/docs/rules/class-methods-use-this
// https://eslint.org/docs/rules/class-methods-use-this
'class-methods-use-this': ['error', {

@@ -37,7 +37,7 @@ exceptMethods: [],

// enforces consistent newlines before or after dots
// http://eslint.org/docs/rules/dot-location
// https://eslint.org/docs/rules/dot-location
'dot-location': ['error', 'property'],
// require the use of === and !==
// http://eslint.org/docs/rules/eqeqeq
// https://eslint.org/docs/rules/eqeqeq
eqeqeq: ['error', 'always', { null: 'ignore' }],

@@ -55,7 +55,7 @@

// disallow lexical declarations in case/default clauses
// http://eslint.org/docs/rules/no-case-declarations.html
// https://eslint.org/docs/rules/no-case-declarations.html
'no-case-declarations': 'error',
// disallow division operators explicitly at beginning of regular expression
// http://eslint.org/docs/rules/no-div-regex
// https://eslint.org/docs/rules/no-div-regex
'no-div-regex': 'off',

@@ -65,7 +65,6 @@

// https://eslint.org/docs/rules/no-else-return
// TODO: semver-major, set allowElseIf to false
'no-else-return': ['error', { allowElseIf: true }],
'no-else-return': ['error', { allowElseIf: false }],
// disallow empty functions, except for standalone funcs/arrows
// http://eslint.org/docs/rules/no-empty-function
// https://eslint.org/docs/rules/no-empty-function
'no-empty-function': ['error', {

@@ -80,3 +79,3 @@ allow: [

// disallow empty destructuring patterns
// http://eslint.org/docs/rules/no-empty-pattern
// https://eslint.org/docs/rules/no-empty-pattern
'no-empty-pattern': 'error',

@@ -97,3 +96,3 @@

// disallow Unnecessary Labels
// http://eslint.org/docs/rules/no-extra-label
// https://eslint.org/docs/rules/no-extra-label
'no-extra-label': 'error',

@@ -108,3 +107,3 @@

// disallow reassignments of native objects or read-only globals
// http://eslint.org/docs/rules/no-global-assign
// https://eslint.org/docs/rules/no-global-assign
'no-global-assign': ['error', { exceptions: [] }],

@@ -115,3 +114,3 @@ // deprecated in favor of no-global-assign

// disallow implicit type conversions
// http://eslint.org/docs/rules/no-implicit-coercion
// https://eslint.org/docs/rules/no-implicit-coercion
'no-implicit-coercion': ['off', {

@@ -125,3 +124,3 @@ boolean: false,

// disallow var and named functions in global scope
// http://eslint.org/docs/rules/no-implicit-globals
// https://eslint.org/docs/rules/no-implicit-globals
'no-implicit-globals': 'off',

@@ -148,3 +147,3 @@

// disallow magic numbers
// http://eslint.org/docs/rules/no-magic-numbers
// https://eslint.org/docs/rules/no-magic-numbers
'no-magic-numbers': ['off', {

@@ -183,3 +182,3 @@ ignore: [],

// disallow parameter object manipulation except for specific exclusions
// rule: http://eslint.org/docs/rules/no-param-reassign.html
// rule: https://eslint.org/docs/rules/no-param-reassign.html
'no-param-reassign': ['error', {

@@ -189,2 +188,3 @@ props: true,

'acc', // for reduce accumulators
'accumulator', // for reduce accumulators
'e', // for e.returnvalue

@@ -207,3 +207,3 @@ 'ctx', // for Koa routing

// disallow certain object properties
// http://eslint.org/docs/rules/no-restricted-properties
// https://eslint.org/docs/rules/no-restricted-properties
'no-restricted-properties': ['error', {

@@ -259,3 +259,3 @@ object: 'arguments',

// disallow self assignment
// http://eslint.org/docs/rules/no-self-assign
// https://eslint.org/docs/rules/no-self-assign
'no-self-assign': 'error',

@@ -273,3 +273,3 @@

// disallow unmodified conditions of loops
// http://eslint.org/docs/rules/no-unmodified-loop-condition
// https://eslint.org/docs/rules/no-unmodified-loop-condition
'no-unmodified-loop-condition': 'off',

@@ -285,3 +285,3 @@

// disallow unused labels
// http://eslint.org/docs/rules/no-unused-labels
// https://eslint.org/docs/rules/no-unused-labels
'no-unused-labels': 'error',

@@ -293,15 +293,15 @@

// disallow useless string concatenation
// http://eslint.org/docs/rules/no-useless-concat
// https://eslint.org/docs/rules/no-useless-concat
'no-useless-concat': 'error',
// disallow unnecessary string escaping
// http://eslint.org/docs/rules/no-useless-escape
// https://eslint.org/docs/rules/no-useless-escape
'no-useless-escape': 'error',
// disallow redundant return; keywords
// http://eslint.org/docs/rules/no-useless-return
// https://eslint.org/docs/rules/no-useless-return
'no-useless-return': 'error',
// disallow use of void operator
// http://eslint.org/docs/rules/no-void
// https://eslint.org/docs/rules/no-void
'no-void': 'error',

@@ -316,3 +316,3 @@

// require using Error objects as Promise rejection reasons
// http://eslint.org/docs/rules/prefer-promise-reject-errors
// https://eslint.org/docs/rules/prefer-promise-reject-errors
'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],

@@ -324,3 +324,3 @@

// require `await` in `async function` (note: this is a horrible rule that should never be used)
// http://eslint.org/docs/rules/require-await
// https://eslint.org/docs/rules/require-await
'require-await': 'off',

@@ -332,3 +332,3 @@

// require immediate function invocation to be wrapped in parentheses
// http://eslint.org/docs/rules/wrap-iife.html
// https://eslint.org/docs/rules/wrap-iife.html
'wrap-iife': ['error', 'outside', { functionPrototypeMethods: false }],

@@ -335,0 +335,0 @@

module.exports = {
rules: {
// Enforce “for” loop update clause moving the counter in the right direction
// http://eslint.org/docs/rules/for-direction
// https://eslint.org/docs/rules/for-direction
'for-direction': 'error',
// Enforces that a return statement is present in property getters
// http://eslint.org/docs/rules/getter-return
// https://eslint.org/docs/rules/getter-return
'getter-return': ['error', { allowImplicit: true }],
// Disallow await inside of loops
// http://eslint.org/docs/rules/no-await-in-loop
// https://eslint.org/docs/rules/no-await-in-loop
'no-await-in-loop': 'error',
// Disallow comparisons to negative zero
// http://eslint.org/docs/rules/no-compare-neg-zero
// https://eslint.org/docs/rules/no-compare-neg-zero
'no-compare-neg-zero': 'error',

@@ -53,7 +53,7 @@

// disallow double-negation boolean casts in a boolean context
// http://eslint.org/docs/rules/no-extra-boolean-cast
// https://eslint.org/docs/rules/no-extra-boolean-cast
'no-extra-boolean-cast': 'error',
// disallow unnecessary parentheses
// http://eslint.org/docs/rules/no-extra-parens
// https://eslint.org/docs/rules/no-extra-parens
'no-extra-parens': ['off', 'all', {

@@ -86,3 +86,3 @@ conditionalAssign: true,

// disallow use of Object.prototypes builtins directly
// http://eslint.org/docs/rules/no-prototype-builtins
// https://eslint.org/docs/rules/no-prototype-builtins
'no-prototype-builtins': 'error',

@@ -97,7 +97,7 @@

// Disallow template literal placeholder syntax in regular strings
// http://eslint.org/docs/rules/no-template-curly-in-string
// https://eslint.org/docs/rules/no-template-curly-in-string
'no-template-curly-in-string': 'error',
// Avoid code that looks like two expressions but is actually one
// http://eslint.org/docs/rules/no-unexpected-multiline
// https://eslint.org/docs/rules/no-unexpected-multiline
'no-unexpected-multiline': 'error',

@@ -109,7 +109,7 @@

// disallow return/throw/break/continue inside finally blocks
// http://eslint.org/docs/rules/no-unsafe-finally
// https://eslint.org/docs/rules/no-unsafe-finally
'no-unsafe-finally': 'error',
// disallow negating the left operand of relational operators
// http://eslint.org/docs/rules/no-unsafe-negation
// https://eslint.org/docs/rules/no-unsafe-negation
'no-unsafe-negation': 'error',

@@ -124,9 +124,9 @@ // disallow negation of the left operand of an in expression

// ensure JSDoc comments are valid
// http://eslint.org/docs/rules/valid-jsdoc
// https://eslint.org/docs/rules/valid-jsdoc
'valid-jsdoc': 'off',
// ensure that the results of typeof are compared against a valid string
// http://eslint.org/docs/rules/valid-typeof
// https://eslint.org/docs/rules/valid-typeof
'valid-typeof': ['error', { requireStringLiterals: true }],
}
};

@@ -16,3 +16,3 @@ module.exports = {

// enforces no braces where they can be omitted
// http://eslint.org/docs/rules/arrow-body-style
// https://eslint.org/docs/rules/arrow-body-style
// TODO: enable requireReturnForObjectLiteral?

@@ -24,3 +24,3 @@ 'arrow-body-style': ['error', 'as-needed', {

// require parens in arrow function arguments
// http://eslint.org/docs/rules/arrow-parens
// https://eslint.org/docs/rules/arrow-parens
'arrow-parens': ['error', 'as-needed', {

@@ -31,3 +31,3 @@ requireForBlockBody: true,

// require space before/after arrow function's arrow
// http://eslint.org/docs/rules/arrow-spacing
// https://eslint.org/docs/rules/arrow-spacing
'arrow-spacing': ['error', { before: true, after: true }],

@@ -39,11 +39,11 @@

// enforce the spacing around the * in generator functions
// http://eslint.org/docs/rules/generator-star-spacing
// https://eslint.org/docs/rules/generator-star-spacing
'generator-star-spacing': ['error', { before: false, after: true }],
// disallow modifying variables of class declarations
// http://eslint.org/docs/rules/no-class-assign
// https://eslint.org/docs/rules/no-class-assign
'no-class-assign': 'error',
// disallow arrow functions where they could be confused with comparisons
// http://eslint.org/docs/rules/no-confusing-arrow
// https://eslint.org/docs/rules/no-confusing-arrow
'no-confusing-arrow': ['error', {

@@ -57,7 +57,7 @@ allowParens: true,

// disallow duplicate class members
// http://eslint.org/docs/rules/no-dupe-class-members
// https://eslint.org/docs/rules/no-dupe-class-members
'no-dupe-class-members': 'error',
// disallow importing from the same path more than once
// http://eslint.org/docs/rules/no-duplicate-imports
// https://eslint.org/docs/rules/no-duplicate-imports
// replaced by https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md

@@ -67,23 +67,26 @@ 'no-duplicate-imports': 'off',

// disallow symbol constructor
// http://eslint.org/docs/rules/no-new-symbol
// https://eslint.org/docs/rules/no-new-symbol
'no-new-symbol': 'error',
// disallow specific imports
// http://eslint.org/docs/rules/no-restricted-imports
'no-restricted-imports': 'off',
// https://eslint.org/docs/rules/no-restricted-imports
'no-restricted-imports': ['off', {
paths: [],
patterns: []
}],
// disallow to use this/super before super() calling in constructors.
// http://eslint.org/docs/rules/no-this-before-super
// https://eslint.org/docs/rules/no-this-before-super
'no-this-before-super': 'error',
// disallow useless computed property keys
// http://eslint.org/docs/rules/no-useless-computed-key
// https://eslint.org/docs/rules/no-useless-computed-key
'no-useless-computed-key': 'error',
// disallow unnecessary constructor
// http://eslint.org/docs/rules/no-useless-constructor
// https://eslint.org/docs/rules/no-useless-constructor
'no-useless-constructor': 'error',
// disallow renaming import, export, and destructured assignments to the same name
// http://eslint.org/docs/rules/no-useless-rename
// https://eslint.org/docs/rules/no-useless-rename
'no-useless-rename': ['error', {

@@ -99,3 +102,3 @@ ignoreDestructuring: false,

// require method and property shorthand syntax for object literals
// http://eslint.org/docs/rules/object-shorthand
// https://eslint.org/docs/rules/object-shorthand
'object-shorthand': ['error', 'always', {

@@ -119,3 +122,3 @@ ignoreConstructors: false,

// Prefer destructuring from arrays and objects
// http://eslint.org/docs/rules/prefer-destructuring
// https://eslint.org/docs/rules/prefer-destructuring
'prefer-destructuring': ['error', {

@@ -135,31 +138,31 @@ VariableDeclarator: {

// disallow parseInt() in favor of binary, octal, and hexadecimal literals
// http://eslint.org/docs/rules/prefer-numeric-literals
// https://eslint.org/docs/rules/prefer-numeric-literals
'prefer-numeric-literals': 'error',
// suggest using Reflect methods where applicable
// http://eslint.org/docs/rules/prefer-reflect
// https://eslint.org/docs/rules/prefer-reflect
'prefer-reflect': 'off',
// use rest parameters instead of arguments
// http://eslint.org/docs/rules/prefer-rest-params
// https://eslint.org/docs/rules/prefer-rest-params
'prefer-rest-params': 'error',
// suggest using the spread operator instead of .apply()
// http://eslint.org/docs/rules/prefer-spread
// https://eslint.org/docs/rules/prefer-spread
'prefer-spread': 'error',
// suggest using template literals instead of string concatenation
// http://eslint.org/docs/rules/prefer-template
// https://eslint.org/docs/rules/prefer-template
'prefer-template': 'error',
// disallow generator functions that do not have yield
// http://eslint.org/docs/rules/require-yield
// https://eslint.org/docs/rules/require-yield
'require-yield': 'error',
// enforce spacing between object rest-spread
// http://eslint.org/docs/rules/rest-spread-spacing
// https://eslint.org/docs/rules/rest-spread-spacing
'rest-spread-spacing': ['error', 'never'],
// import sorting
// http://eslint.org/docs/rules/sort-imports
// https://eslint.org/docs/rules/sort-imports
'sort-imports': ['off', {

@@ -172,13 +175,13 @@ ignoreCase: false,

// require a Symbol description
// http://eslint.org/docs/rules/symbol-description
// https://eslint.org/docs/rules/symbol-description
'symbol-description': 'error',
// enforce usage of spacing in template strings
// http://eslint.org/docs/rules/template-curly-spacing
// https://eslint.org/docs/rules/template-curly-spacing
'template-curly-spacing': 'error',
// enforce spacing around the * in yield* expressions
// http://eslint.org/docs/rules/yield-star-spacing
// https://eslint.org/docs/rules/yield-star-spacing
'yield-star-spacing': ['error', 'after']
}
};

@@ -16,3 +16,3 @@ module.exports = {

node: {
extensions: ['.js', '.json']
extensions: ['.mjs', '.js', '.json']
}

@@ -22,2 +22,3 @@ },

'.js',
'.mjs',
'.jsx',

@@ -42,3 +43,3 @@ ],

// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
'import/named': 'off',
'import/named': 'error',

@@ -79,6 +80,8 @@ // ensure default import coupled with default export

'**/__tests__/**', // jest pattern
'**/__mocks__/**', // jest pattern
'test.{js,jsx}', // repos with a single test file
'test-*.{js,jsx}', // repos with multiple top-level test files
'**/*.{test,spec}.{js,jsx}', // tests where the extension denotes that it is a test
'**/*{.,_}{test,spec}.{js,jsx}', // tests where the extension or filename suffix denotes that it is a test
'**/jest.config.js', // jest config
'**/vue.config.js', // vue-cli config
'**/webpack.config.js', // webpack config

@@ -120,3 +123,3 @@ '**/webpack.config.*.js', // webpack config

// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/first.md
'import/first': ['error', 'absolute-first'],
'import/first': 'error',

@@ -139,14 +142,12 @@ // disallow non-import statements appearing before import statements

// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
'import/extensions': ['error', 'always', {
'import/extensions': ['error', 'ignorePackages', {
js: 'never',
mjs: 'never',
jsx: 'never',
}],
// Enforce a convention in module import order
// ensure absolute imports are above relative imports and that unassigned imports are ignored
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
// TODO: enable?
'import/order': ['off', {
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'never',
}],
// TODO: enforce a stricter convention in module import order?
'import/order': ['error', { groups: [['builtin', 'external', 'internal']] }],

@@ -213,3 +214,37 @@ // Require a newline after the last import/require in a group

}],
// This rule enforces that all exports are declared at the bottom of the file.
// https://github.com/benmosher/eslint-plugin-import/blob/98acd6afd04dcb6920b81330114e146dc8532ea4/docs/rules/exports-last.md
// TODO: enable?
'import/exports-last': 'off',
// Reports when named exports are not grouped together in a single export declaration
// or when multiple assignments to CommonJS module.exports or exports object are present
// in a single file.
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/group-exports.md
'import/group-exports': 'off',
// forbid default exports. this is a terrible rule, do not use it.
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-default-export.md
'import/no-default-export': 'off',
// Forbid a module from importing itself
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md
'import/no-self-import': 'error',
// Forbid cyclical dependencies between modules
// https://github.com/benmosher/eslint-plugin-import/blob/d81f48a2506182738409805f5272eff4d77c9348/docs/rules/no-cycle.md
'import/no-cycle': ['error', { maxDepth: Infinity }],
// Ensures that there are no useless path segments
// https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/no-useless-path-segments.md
'import/no-useless-path-segments': 'error',
// dynamic imports require a leading comment with a webpackChunkName
// https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/dynamic-import-chunkname.md
'import/dynamic-import-chunkname': ['off', {
importFunctions: [],
webpackChunknameFormat: '[0-9a-zA-Z-_/.]+',
}],
},
};

@@ -11,3 +11,3 @@ module.exports = {

// require all requires be top-level
// http://eslint.org/docs/rules/global-require
// https://eslint.org/docs/rules/global-require
'global-require': 'error',

@@ -19,3 +19,3 @@

// disallow use of the Buffer() constructor
// http://eslint.org/docs/rules/no-buffer-constructor
// https://eslint.org/docs/rules/no-buffer-constructor
'no-buffer-constructor': 'error',

@@ -30,3 +30,3 @@

// disallow string concatenation with __dirname and __filename
// http://eslint.org/docs/rules/no-path-concat
// https://eslint.org/docs/rules/no-path-concat
'no-path-concat': 'error',

@@ -33,0 +33,0 @@

module.exports = {
rules: {
// enforce line breaks after opening and before closing array brackets
// http://eslint.org/docs/rules/array-bracket-newline
// https://eslint.org/docs/rules/array-bracket-newline
// TODO: enable? semver-major

@@ -9,3 +9,3 @@ 'array-bracket-newline': ['off', 'consistent'], // object option alternative: { multiline: true, minItems: 3 }

// enforce line breaks between array elements
// http://eslint.org/docs/rules/array-element-newline
// https://eslint.org/docs/rules/array-element-newline
// TODO: enable? semver-major

@@ -18,3 +18,3 @@ 'array-element-newline': ['off', { multiline: true, minItems: 3 }],

// enforce spacing inside single-line blocks
// http://eslint.org/docs/rules/block-spacing
// https://eslint.org/docs/rules/block-spacing
'block-spacing': ['error', 'always'],

@@ -29,3 +29,3 @@

// enforce or disallow capitalization of the first letter of a comment
// http://eslint.org/docs/rules/capitalized-comments
// https://eslint.org/docs/rules/capitalized-comments
'capitalized-comments': ['off', 'never', {

@@ -57,3 +57,17 @@ line: {

// enforce one true comma style
'comma-style': ['error', 'last'],
'comma-style': ['error', 'last', {
exceptions: {
ArrayExpression: false,
ArrayPattern: false,
ArrowFunctionExpression: false,
CallExpression: false,
FunctionDeclaration: false,
FunctionExpression: false,
ImportDeclaration: false,
ObjectExpression: false,
ObjectPattern: false,
VariableDeclaration: false,
NewExpression: false,
}
}],

@@ -70,3 +84,3 @@ // disallow padding inside computed properties

// enforce spacing between functions and their invocations
// http://eslint.org/docs/rules/func-call-spacing
// https://eslint.org/docs/rules/func-call-spacing
'func-call-spacing': ['error', 'never'],

@@ -76,3 +90,3 @@

// assigned
// http://eslint.org/docs/rules/func-name-matching
// https://eslint.org/docs/rules/func-name-matching
'func-name-matching': ['off', 'always', {

@@ -83,7 +97,7 @@ includeCommonJSModuleExports: false

// require function expressions to have a name
// http://eslint.org/docs/rules/func-names
// https://eslint.org/docs/rules/func-names
'func-names': 'warn',
// enforces use of function declarations or expressions
// http://eslint.org/docs/rules/func-style
// https://eslint.org/docs/rules/func-style
// TODO: enable

@@ -94,6 +108,6 @@ 'func-style': ['off', 'expression'],

// https://eslint.org/docs/rules/function-paren-newline
'function-paren-newline': ['error', 'multiline'],
'function-paren-newline': ['error', 'consistent'],
// Blacklist certain identifiers to prevent them being used
// http://eslint.org/docs/rules/id-blacklist
// https://eslint.org/docs/rules/id-blacklist
'id-blacklist': 'off',

@@ -108,4 +122,8 @@

// Enforce the location of arrow function bodies with implicit returns
// https://eslint.org/docs/rules/implicit-arrow-linebreak
'implicit-arrow-linebreak': ['error', 'beside'],
// this option sets a specific tab width for your code
// http://eslint.org/docs/rules/indent
// https://eslint.org/docs/rules/indent
indent: ['error', 2, {

@@ -131,7 +149,9 @@ SwitchCase: 1,

flatTernaryExpressions: false,
ignoredNodes: ['JSXElement', 'JSXElement *']
// list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
ignoredNodes: ['JSXElement', 'JSXElement > *', 'JSXAttribute', 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', 'JSXSpreadAttribute', 'JSXExpressionContainer', 'JSXOpeningElement', 'JSXClosingElement', 'JSXText', 'JSXEmptyExpression', 'JSXSpreadChild'],
ignoreComments: false
}],
// specify whether double or single quotes should be used in JSX attributes
// http://eslint.org/docs/rules/jsx-quotes
// https://eslint.org/docs/rules/jsx-quotes
'jsx-quotes': ['off', 'prefer-double'],

@@ -154,3 +174,3 @@

// enforce position of line comments
// http://eslint.org/docs/rules/line-comment-position
// https://eslint.org/docs/rules/line-comment-position
// TODO: enable?

@@ -164,3 +184,3 @@ 'line-comment-position': ['off', {

// disallow mixed 'LF' and 'CRLF' as linebreaks
// http://eslint.org/docs/rules/linebreak-style
// https://eslint.org/docs/rules/linebreak-style
'linebreak-style': ['error', 'unix'],

@@ -170,4 +190,3 @@

// https://eslint.org/docs/rules/lines-between-class-members
// TODO: semver-major: enable
'lines-between-class-members': ['off', 'always', { exceptAfterSingleLine: false }],
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: false }],

@@ -178,3 +197,3 @@ // enforces empty lines around comments

// require or disallow newlines around directives
// http://eslint.org/docs/rules/lines-around-directive
// https://eslint.org/docs/rules/lines-around-directive
'lines-around-directive': ['error', {

@@ -189,3 +208,3 @@ before: 'always',

// specify the maximum length of a line in your program
// http://eslint.org/docs/rules/max-len
// https://eslint.org/docs/rules/max-len
'max-len': ['error', 100, 2, {

@@ -200,3 +219,3 @@ ignoreUrls: true,

// specify the max number of lines in a file
// http://eslint.org/docs/rules/max-lines
// https://eslint.org/docs/rules/max-lines
'max-lines': ['off', {

@@ -218,3 +237,3 @@ max: 300,

// restrict the number of statements per line
// http://eslint.org/docs/rules/max-statements-per-line
// https://eslint.org/docs/rules/max-statements-per-line
'max-statements-per-line': ['off', { max: 1 }],

@@ -227,3 +246,3 @@

// require multiline ternary
// http://eslint.org/docs/rules/multiline-ternary
// https://eslint.org/docs/rules/multiline-ternary
// TODO: enable?

@@ -241,3 +260,3 @@ 'multiline-ternary': ['off', 'never'],

// disallow the omission of parentheses when invoking a constructor with no arguments
// http://eslint.org/docs/rules/new-parens
// https://eslint.org/docs/rules/new-parens
'new-parens': 'error',

@@ -248,3 +267,3 @@

// http://eslint.org/docs/rules/newline-before-return
// https://eslint.org/docs/rules/newline-before-return
'newline-before-return': 'off',

@@ -254,3 +273,3 @@

// more readable and easy to maintain
// http://eslint.org/docs/rules/newline-per-chained-call
// https://eslint.org/docs/rules/newline-per-chained-call
'newline-per-chained-call': ['error', { ignoreChainWithDepth: 4 }],

@@ -262,7 +281,7 @@

// disallow use of bitwise operators
// http://eslint.org/docs/rules/no-bitwise
// https://eslint.org/docs/rules/no-bitwise
'no-bitwise': 'error',
// disallow use of the continue statement
// http://eslint.org/docs/rules/no-continue
// https://eslint.org/docs/rules/no-continue
'no-continue': 'error',

@@ -274,10 +293,20 @@

// disallow if as the only statement in an else block
// http://eslint.org/docs/rules/no-lonely-if
// https://eslint.org/docs/rules/no-lonely-if
'no-lonely-if': 'error',
// disallow un-paren'd mixes of different operators
// http://eslint.org/docs/rules/no-mixed-operators
// https://eslint.org/docs/rules/no-mixed-operators
'no-mixed-operators': ['error', {
// the list of arthmetic groups disallows mixing `%` and `**`
// with other arithmetic operators.
groups: [
['+', '-', '*', '/', '%', '**'],
['%', '**'],
['%', '+'],
['%', '-'],
['%', '*'],
['%', '/'],
['**', '+'],
['**', '-'],
['**', '*'],
['**', '/'],
['&', '|', '^', '~', '<<', '>>', '>>>'],

@@ -295,10 +324,10 @@ ['==', '!=', '===', '!==', '>', '>=', '<', '<='],

// disallow use of chained assignment expressions
// http://eslint.org/docs/rules/no-multi-assign
// https://eslint.org/docs/rules/no-multi-assign
'no-multi-assign': ['error'],
// disallow multiple empty lines and only one newline at the end
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 1 }],
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0 }],
// disallow negated conditions
// http://eslint.org/docs/rules/no-negated-condition
// https://eslint.org/docs/rules/no-negated-condition
'no-negated-condition': 'off',

@@ -313,7 +342,7 @@

// disallow use of unary operators, ++ and --
// http://eslint.org/docs/rules/no-plusplus
// https://eslint.org/docs/rules/no-plusplus
'no-plusplus': 'error',
// disallow certain syntax forms
// http://eslint.org/docs/rules/no-restricted-syntax
// https://eslint.org/docs/rules/no-restricted-syntax
'no-restricted-syntax': [

@@ -364,12 +393,12 @@ 'error',

// also, prefer `a || b` over `a ? a : b`
// http://eslint.org/docs/rules/no-unneeded-ternary
// https://eslint.org/docs/rules/no-unneeded-ternary
'no-unneeded-ternary': ['error', { defaultAssignment: false }],
// disallow whitespace before properties
// http://eslint.org/docs/rules/no-whitespace-before-property
// https://eslint.org/docs/rules/no-whitespace-before-property
'no-whitespace-before-property': 'error',
// enforce the location of single-line statements
// http://eslint.org/docs/rules/nonblock-statement-body-position
'nonblock-statement-body-position': 'off',
// https://eslint.org/docs/rules/nonblock-statement-body-position
'nonblock-statement-body-position': ['error', 'beside', { overrides: {} }],

@@ -380,12 +409,14 @@ // require padding inside curly braces

// enforce line breaks between braces
// http://eslint.org/docs/rules/object-curly-newline
// https://eslint.org/docs/rules/object-curly-newline
'object-curly-newline': ['error', {
ObjectExpression: { minProperties: 4, multiline: true, consistent: true },
ObjectPattern: { minProperties: 4, multiline: true, consistent: true }
ObjectPattern: { minProperties: 4, multiline: true, consistent: true },
ImportDeclaration: { minProperties: 4, multiline: true, consistent: true },
ExportDeclaration: { minProperties: 4, multiline: true, consistent: true },
}],
// enforce "same line" or "multiple line" on object properties.
// http://eslint.org/docs/rules/object-property-newline
// https://eslint.org/docs/rules/object-property-newline
'object-property-newline': ['error', {
allowMultiplePropertiesPerLine: true,
allowAllPropertiesOnSameLine: true,
}],

@@ -397,11 +428,12 @@

// require a newline around variable declaration
// http://eslint.org/docs/rules/one-var-declaration-per-line
// https://eslint.org/docs/rules/one-var-declaration-per-line
'one-var-declaration-per-line': ['error', 'always'],
// require assignment operator shorthand where possible or prohibit it entirely
// http://eslint.org/docs/rules/operator-assignment
// https://eslint.org/docs/rules/operator-assignment
'operator-assignment': ['error', 'always'],
// enforce operators to be placed before or after line breaks
'operator-linebreak': 'off',
// Requires operator at the beginning of the line in multiline statements
// https://eslint.org/docs/rules/operator-linebreak
'operator-linebreak': ['error', 'before', { overrides: { '=': 'none' } }],

@@ -412,7 +444,7 @@ // disallow padding within blocks

// Require or disallow padding lines between statements
// http://eslint.org/docs/rules/padding-line-between-statements
// https://eslint.org/docs/rules/padding-line-between-statements
'padding-line-between-statements': 'off',
// require quotes around object literal property names
// http://eslint.org/docs/rules/quote-props.html
// https://eslint.org/docs/rules/quote-props.html
'quote-props': ['error', 'as-needed', { keywords: false, unnecessary: true, numbers: false }],

@@ -424,3 +456,3 @@

// do not require jsdoc
// http://eslint.org/docs/rules/require-jsdoc
// https://eslint.org/docs/rules/require-jsdoc
'require-jsdoc': 'off',

@@ -435,3 +467,3 @@

// Enforce location of semicolons
// http://eslint.org/docs/rules/semi-style
// https://eslint.org/docs/rules/semi-style
'semi-style': ['error', 'last'],

@@ -449,3 +481,3 @@

// require or disallow space before function opening parenthesis
// http://eslint.org/docs/rules/space-before-function-paren
// https://eslint.org/docs/rules/space-before-function-paren
'space-before-function-paren': ['error', {

@@ -464,3 +496,3 @@ anonymous: 'always',

// Require or disallow spaces before/after unary operators
// http://eslint.org/docs/rules/space-unary-ops
// https://eslint.org/docs/rules/space-unary-ops
'space-unary-ops': ['error', {

@@ -474,3 +506,3 @@ words: true,

// require or disallow a space immediately following the // or /* in a comment
// http://eslint.org/docs/rules/spaced-comment
// https://eslint.org/docs/rules/spaced-comment
'spaced-comment': ['error', 'always', {

@@ -489,11 +521,11 @@ line: {

// Enforce spacing around colons of switch statements
// http://eslint.org/docs/rules/switch-colon-spacing
// https://eslint.org/docs/rules/switch-colon-spacing
'switch-colon-spacing': ['error', { after: true, before: false }],
// Require or disallow spacing between template tags and their literals
// http://eslint.org/docs/rules/template-tag-spacing
// https://eslint.org/docs/rules/template-tag-spacing
'template-tag-spacing': ['error', 'never'],
// require or disallow the Unicode Byte Order Mark
// http://eslint.org/docs/rules/unicode-bom
// https://eslint.org/docs/rules/unicode-bom
'unicode-bom': ['error', 'never'],

@@ -500,0 +532,0 @@

@@ -15,3 +15,3 @@ const restrictedGlobals = require('eslint-restricted-globals');

// disallow labels that share a name with a variable
// http://eslint.org/docs/rules/no-label-var
// https://eslint.org/docs/rules/no-label-var
'no-label-var': 'error',

@@ -35,3 +35,3 @@

// disallow use of undefined variable
// http://eslint.org/docs/rules/no-undefined
// https://eslint.org/docs/rules/no-undefined
// TODO: enable?

@@ -38,0 +38,0 @@ 'no-undefined': 'off',

@@ -5,3 +5,3 @@ import fs from 'fs';

import index from '../';
import index from '..';

@@ -15,5 +15,5 @@ const files = { ...{ index } }; // object spread is to test parsing

Object.keys(files).forEach(( // eslint-disable-line function-paren-newline
Object.keys(files).forEach((
name, // trailing function comma is to test parsing
) => { // eslint-disable-line function-paren-newline
) => {
const config = files[name];

@@ -25,4 +25,4 @@

// scan plugins for react and fail if it is found
const hasReactPlugin = Object.prototype.hasOwnProperty.call(config, 'plugins') &&
config.plugins.indexOf('react') !== -1;
const hasReactPlugin = Object.prototype.hasOwnProperty.call(config, 'plugins')
&& config.plugins.indexOf('react') !== -1;
t.notOk(hasReactPlugin, 'there is no react plugin');

@@ -29,0 +29,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc