eslint-config-mgol
Advanced tools
Comparing version 0.0.42 to 0.0.44
@@ -18,2 +18,3 @@ 'use strict'; | ||
'getter-return': 'error', | ||
'no-async-promise-executor': 'error', | ||
'no-await-in-loop': 'error', | ||
@@ -23,3 +24,3 @@ 'no-compare-neg-zero': 'error', | ||
'no-console': 'off', | ||
'no-constant-condition': ['error', {checkLoops: false}], | ||
'no-constant-condition': ['error', { checkLoops: false }], | ||
'no-control-regex': 'error', | ||
@@ -34,8 +35,8 @@ 'no-debugger': 'error', | ||
'no-extra-boolean-cast': 'error', | ||
'no-extra-parens': 'off', | ||
'no-extra-semi': 'error', | ||
'no-func-assign': 'error', | ||
'no-import-assign': 'error', | ||
'no-inner-declarations': 'error', | ||
'no-invalid-regexp': 'error', | ||
'no-irregular-whitespace': 'error', | ||
'no-misleading-character-class': 'error', | ||
'no-obj-calls': 'error', | ||
@@ -46,9 +47,9 @@ 'no-prototype-builtins': 'error', | ||
'no-template-curly-in-string': 'error', | ||
'no-unexpected-multiline': 'error', | ||
'no-unreachable': 'error', | ||
'use-isnan': 'error', | ||
'no-unsafe-finally': 'error', | ||
'no-unsafe-negation': 'error', | ||
'valid-jsdoc': 'off', // TODO enable? | ||
'require-atomic-updates': 'error', | ||
'use-isnan': 'error', | ||
'valid-typeof': 'error', | ||
'no-unexpected-multiline': 'error', | ||
@@ -60,9 +61,2 @@ // Best practices | ||
'class-methods-use-this': 'off', | ||
'comma-dangle': ['error', { | ||
arrays: 'always-multiline', | ||
objects: 'always-multiline', | ||
imports: 'always-multiline', | ||
exports: 'always-multiline', | ||
functions: 'always-multiline', | ||
}], | ||
complexity: ['warn', 10], | ||
@@ -72,6 +66,7 @@ 'consistent-return': 'error', | ||
'default-case': 'error', | ||
'default-param-last': 'error', | ||
'dot-notation': 'error', | ||
'dot-location': ['error', 'property'], | ||
eqeqeq: ['error', 'allow-null'], | ||
'guard-for-in': 'off', | ||
'max-classes-per-file': 'off', | ||
'no-alert': 'error', | ||
@@ -90,5 +85,7 @@ 'no-caller': 'error', | ||
'no-fallthrough': 'error', | ||
'no-floating-decimal': 'error', | ||
'no-global-assign': 'error', | ||
'no-implicit-coercion': ['error', {boolean: false, number: true, string: false}], | ||
'no-implicit-coercion': [ | ||
'error', | ||
{ boolean: false, number: true, string: false }, | ||
], | ||
'no-implicit-globals': 'error', | ||
@@ -98,7 +95,6 @@ 'no-implied-eval': 'error', | ||
'no-iterator': 'error', | ||
'no-labels': ['error', {allowLoop: true, allowSwitch: true}], | ||
'no-labels': ['error', { allowLoop: true, allowSwitch: true }], | ||
'no-lone-blocks': 'off', | ||
'no-loop-func': 'off', | ||
'no-magic-numbers': 'off', | ||
'no-multi-spaces': 'error', | ||
'no-multi-str': 'error', | ||
@@ -127,2 +123,3 @@ 'no-new-func': 'error', | ||
'no-useless-call': 'error', | ||
'no-useless-catch': 'error', | ||
'no-useless-concat': 'error', | ||
@@ -134,7 +131,9 @@ 'no-useless-escape': 'error', | ||
'no-with': 'error', | ||
'prefer-named-capture-group': 'off', // requires ES2018 | ||
'prefer-promise-reject-errors': 'error', | ||
'prefer-regex-literals': 'error', | ||
radix: 'off', | ||
'require-await': 'off', | ||
'require-unicode-regexp': 'off', | ||
'vars-on-top': 'off', | ||
'wrap-iife': ['error', 'inside'], | ||
yoda: 'error', | ||
@@ -147,3 +146,2 @@ | ||
'init-declarations': 'off', | ||
'no-catch-shadow': 'off', | ||
'no-delete-var': 'error', | ||
@@ -157,3 +155,6 @@ 'no-label-var': 'error', | ||
'no-undefined': 'off', | ||
'no-unused-vars': ['error', {vars: 'all', args: 'all', argsIgnorePattern: '^__'}], | ||
'no-unused-vars': [ | ||
'error', | ||
{ vars: 'all', args: 'all', argsIgnorePattern: '^__' }, | ||
], | ||
'no-use-before-define': 'off', | ||
@@ -175,36 +176,11 @@ | ||
// Stylistic issues | ||
'array-bracket-newline': 'off', | ||
'array-bracket-spacing': ['error', 'never'], | ||
'array-element-newline': 'off', | ||
'block-spacing': ['error', 'never'], | ||
'brace-style': 'error', | ||
camelcase: 'off', | ||
'capitalized-comments': 'off', | ||
'comma-spacing': 'error', | ||
'comma-style': 'error', | ||
'computed-property-spacing': ['error', 'never'], | ||
'consistent-this': 'off', | ||
'eol-last': 'error', | ||
'func-call-spacing': ['error', 'never'], | ||
'func-name-matching': 'off', | ||
'func-names': 'off', | ||
'func-style': ['error', 'expression'], | ||
'function-paren-newline': 'off', | ||
'id-blacklist': ['error', 'arguments', 'event'], | ||
indent: ['error', 4, { | ||
SwitchCase: 1, | ||
MemberExpression: 1, | ||
FunctionDeclaration: { | ||
parameters: 'first', | ||
}, | ||
FunctionExpression: { | ||
parameters: 'first', | ||
}, | ||
}], | ||
'id-length': 'off', | ||
'id-match': 'off', | ||
'implicit-arrow-linebreak': 'off', | ||
'jsx-quotes': 'off', | ||
'key-spacing': 'error', | ||
'keyword-spacing': 'error', | ||
'line-comment-position': 'off', | ||
@@ -215,15 +191,17 @@ // Re-enable when commented out lines & ESLint pragmas work; was: | ||
'lines-between-class-members': 'error', | ||
'linebreak-style': 'off', | ||
'max-depth': 'off', | ||
'max-len': ['error', 100, 4, {ignoreUrls: true, ignoreRegExpLiterals: true}], | ||
'max-len': [ | ||
'error', | ||
100, | ||
4, | ||
{ ignoreUrls: true, ignoreRegExpLiterals: true }, | ||
], | ||
'max-lines': 'off', | ||
'max-lines-per-function': 'off', | ||
'max-nested-callbacks': 'off', | ||
'max-params': 'off', | ||
'max-statements': 'off', | ||
'max-statements-per-line': ['error', {max: 1}], | ||
'max-statements-per-line': ['error', { max: 1 }], | ||
'multiline-comment-style': 'off', | ||
'multiline-ternary': 'off', | ||
'new-cap': 'off', | ||
'new-parens': 'error', | ||
'newline-per-chained-call': ['error', {ignoreChainWithDepth: 4}], | ||
'no-array-constructor': 'error', | ||
@@ -234,6 +212,7 @@ 'no-bitwise': 'error', | ||
'no-lonely-if': 'error', | ||
'no-mixed-operators': ['error', {groups: [['&&', '||']], allowSamePrecedence: true}], | ||
'no-mixed-spaces-and-tabs': 'error', | ||
'no-mixed-operators': [ | ||
'error', | ||
{ groups: [['&&', '||']], allowSamePrecedence: true }, | ||
], | ||
'no-multi-assign': 'off', | ||
'no-multiple-empty-lines': ['error', {max: 2, maxEOF: 1}], | ||
'no-nested-ternary': 'error', | ||
@@ -251,3 +230,4 @@ 'no-negated-condition': 'error', | ||
{ | ||
selector: 'CallExpression[callee.object.name="describe"]' + | ||
selector: | ||
'CallExpression[callee.object.name="describe"]' + | ||
'[callee.property.name="only"]', | ||
@@ -261,3 +241,4 @@ message: 'Using `describe.only` is not allowed', | ||
{ | ||
selector: 'CallExpression[callee.object.name="it"][callee.property.name="only"]', | ||
selector: | ||
'CallExpression[callee.object.name="it"][callee.property.name="only"]', | ||
message: 'Using `it.only` is not allowed', | ||
@@ -268,25 +249,17 @@ }, | ||
'no-ternary': 'off', | ||
'no-trailing-spaces': 'error', | ||
'no-underscore-dangle': 'off', | ||
'no-unneeded-ternary': 'error', | ||
'no-whitespace-before-property': 'error', | ||
'nonblock-statement-body-position': 'off', | ||
'object-curly-newline': 'off', | ||
'object-curly-spacing': ['error', 'never'], | ||
'object-property-newline': ['error', {allowMultiplePropertiesPerLine: true}], | ||
'one-var': ['error', {initialized: 'never'}], | ||
'one-var-declaration-per-line': 'off', // I don't use this declaration style | ||
'one-var': ['error', { initialized: 'never' }], | ||
'operator-assignment': 'error', | ||
'operator-linebreak': ['error', 'after'], | ||
'padded-blocks': 'off', | ||
'padding-line-between-statements': ['error', | ||
{blankLine: 'always', prev: 'directive', next: '*'}, | ||
{blankLine: 'always', prev: 'import', next: ['const', 'let', 'class', 'block-like']}, | ||
'padding-line-between-statements': [ | ||
'error', | ||
{ blankLine: 'always', prev: 'directive', next: '*' }, | ||
{ | ||
blankLine: 'always', | ||
prev: 'import', | ||
next: ['const', 'let', 'class', 'block-like'], | ||
}, | ||
], | ||
'quote-props': ['error', 'as-needed'], | ||
'prefer-object-spread': 'error', | ||
quotes: ['error', 'single'], | ||
'require-jsdoc': 'off', | ||
semi: 'error', | ||
'semi-spacing': 'error', | ||
'semi-style': 'error', | ||
'sort-keys': 'off', | ||
@@ -296,27 +269,18 @@ 'sort-vars': 'off', | ||
'symbol-description': 'error', | ||
'space-before-blocks': 'error', | ||
'space-before-function-paren': ['error', {anonymous: 'always', named: 'never'}], | ||
'space-in-parens': ['error', 'never'], | ||
'space-infix-ops': 'error', | ||
'space-unary-ops': 'error', | ||
'spaced-comment': ['error', 'always', { | ||
line: { | ||
exceptions: ['/'], | ||
'spaced-comment': [ | ||
'error', | ||
'always', | ||
{ | ||
line: { | ||
exceptions: ['/'], | ||
}, | ||
block: { | ||
markers: ['*', '**', '!'], | ||
}, | ||
}, | ||
block: { | ||
markers: ['*', '**', '!'], | ||
}, | ||
}], | ||
'switch-colon-spacing': 'error', | ||
'template-tag-spacing': ['error', 'never'], | ||
'unicode-bom': ['error', 'never'], | ||
'wrap-regex': 'off', | ||
], | ||
// ECMAScript 6 | ||
'arrow-body-style': ['error', 'as-needed'], | ||
'arrow-parens': ['error', 'as-needed'], | ||
'arrow-spacing': 'error', | ||
'constructor-super': 'error', | ||
'generator-star-spacing': ['error', {before: true, after: false}], | ||
// Arrow returning a ternary is disallowed; wrapping in braces doesn't help. | ||
'no-class-assign': 'error', | ||
@@ -341,7 +305,4 @@ 'no-confusing-arrow': 'off', | ||
'prefer-template': 'error', | ||
'rest-spread-spacing': ['error', 'never'], | ||
'require-yield': 'off', | ||
'template-curly-spacing': ['error', 'always'], | ||
'yield-star-spacing': ['error', 'after'], | ||
}, | ||
}; |
{ | ||
"name": "eslint-config-mgol", | ||
"version": "0.0.42", | ||
"version": "0.0.44", | ||
"description": "ESLint config for projects written by mgol", | ||
@@ -29,9 +29,33 @@ "main": "eslint-config-mgol.js", | ||
"devDependencies": { | ||
"eslint": "4.19.1", | ||
"eslint-find-rules": "3.2.3" | ||
"eslint": "6.4.0", | ||
"eslint-config-prettier": "6.3.0", | ||
"eslint-find-rules": "3.4.0", | ||
"husky": "3.0.7", | ||
"lint-staged": "9.4.0", | ||
"prettier": "1.18.2" | ||
}, | ||
"scripts": { | ||
"pretest": "eslint-find-rules -u", | ||
"test": "eslint ." | ||
"ensure-all-rules-specified": "eslint-find-rules -u eslint-config-mgol-test.js", | ||
"ensure-prettier-rules-disabled": "eslint --print-config eslint-config-mgol.js | eslint-config-prettier-check", | ||
"prettier-check": "prettier --check '**/*.{json,js,jsx,ts,tsx,md}'", | ||
"prettier-format": "prettier --write '**/*.{json,js,jsx,ts,tsx,md}'", | ||
"lint": "eslint . && npm run prettier-check", | ||
"test": "npm run ensure-prettier-rules-disabled && npm run ensure-all-rules-specified && npm run lint" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.{json,md}": [ | ||
"prettier --write", | ||
"git add" | ||
], | ||
"*.{ts,tsx,js,jsx}": [ | ||
"eslint --fix", | ||
"prettier --write", | ||
"git add" | ||
] | ||
} | ||
} |
@@ -15,3 +15,3 @@ # eslint-config-mgol | ||
``` | ||
npm install --save-dev eslint eslint-config-mgol | ||
npm install --save-dev eslint eslint-config-mgol | ||
``` | ||
@@ -18,0 +18,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13606
6
278