eslint-config-xo-lass
Advanced tools
Comparing version 1.0.6 to 2.0.1
470
index.js
@@ -0,1 +1,3 @@ | ||
const process = require('process'); | ||
module.exports = { | ||
@@ -5,25 +7,467 @@ parserOptions: { | ||
}, | ||
reportUnusedDisableDirectives: true, | ||
rules: { | ||
'max-len': [ | ||
// eslint-config-xo-lass | ||
camelcase: 'off', | ||
'capitalized-comments': 'off', | ||
'import/extensions': 'off', | ||
'unicorn/catch-error-name': ['error', { name: 'err' }], | ||
'unicorn/import-style': 'off', | ||
'unicorn/prefer-module': 'off', | ||
'unicorn/prevent-abbreviations': 'off', | ||
'unicorn/no-this-assignment': 'off', | ||
'unicorn/numeric-separators-style': 'off', | ||
quotes: ['error', 'single', { avoidEscape: true }], | ||
// eslint-config-xo | ||
'for-direction': 'error', | ||
'getter-return': 'error', | ||
'no-async-promise-executor': 'error', | ||
'no-await-in-loop': 'error', | ||
'no-compare-neg-zero': 'error', | ||
'no-cond-assign': 'error', | ||
'no-constant-condition': 'error', | ||
'no-control-regex': 'error', | ||
'no-debugger': 'error', | ||
'no-dupe-args': 'error', | ||
'no-dupe-else-if': 'error', | ||
'no-dupe-keys': 'error', | ||
'no-duplicate-case': 'error', | ||
'no-empty-character-class': 'error', | ||
'no-empty': [ | ||
'error', | ||
{ | ||
code: 80, | ||
ignoreUrls: true | ||
allowEmptyCatch: true | ||
} | ||
], | ||
'capitalized-comments': 'off', | ||
camelcase: 'off', | ||
'no-warning-comments': 'off', | ||
'ava/no-todo-test': 'off', | ||
'unicorn/catch-error-name': [ | ||
'no-ex-assign': 'error', | ||
'no-extra-boolean-cast': 'error', | ||
// Disabled because of https://github.com/eslint/eslint/issues/6028 | ||
// 'no-extra-parens': [ | ||
// 'error', | ||
// 'all', | ||
// { | ||
// conditionalAssign: false, | ||
// nestedBinaryExpressions: false, | ||
// ignoreJSX: 'multi-line' | ||
// } | ||
// ], | ||
'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-loss-of-precision': 'error', | ||
'no-misleading-character-class': 'error', | ||
'no-obj-calls': 'error', | ||
'no-promise-executor-return': 'error', | ||
'no-prototype-builtins': 'error', | ||
'no-regex-spaces': 'error', | ||
'no-setter-return': 'error', | ||
'no-sparse-arrays': 'error', | ||
'no-template-curly-in-string': 'error', | ||
'no-unreachable': 'error', | ||
'no-unreachable-loop': 'error', | ||
'no-unsafe-finally': 'error', | ||
'no-unsafe-negation': [ | ||
'error', | ||
{ | ||
name: 'err' | ||
enforceForOrderingRelations: true | ||
} | ||
], | ||
'unicorn/import-style': 'off', | ||
'unicorn/prevent-abbreviations': 'off', | ||
'import/extensions': 'off', | ||
'unicorn/prefer-module': 'off' | ||
'no-unsafe-optional-chaining': [ | ||
'error', | ||
{ | ||
disallowArithmeticOperators: true | ||
} | ||
], | ||
'no-useless-backreference': 'error', | ||
'use-isnan': 'error', | ||
'valid-typeof': [ | ||
'error', | ||
{ | ||
requireStringLiterals: false | ||
} | ||
], | ||
'no-unexpected-multiline': 'error', | ||
'accessor-pairs': [ | ||
'error', | ||
{ | ||
enforceForClassMembers: true | ||
} | ||
], | ||
'array-callback-return': [ | ||
'error', | ||
{ | ||
allowImplicit: true | ||
} | ||
], | ||
'block-scoped-var': 'error', | ||
complexity: 'warn', | ||
'default-case': 'error', | ||
'default-case-last': 'error', | ||
'dot-notation': 'error', | ||
'dot-location': ['error', 'property'], | ||
eqeqeq: 'error', | ||
'grouped-accessor-pairs': ['error', 'getBeforeSet'], | ||
'guard-for-in': 'error', | ||
'no-alert': 'error', | ||
'no-caller': 'error', | ||
'no-case-declarations': 'error', | ||
'no-constructor-return': 'error', | ||
'no-else-return': [ | ||
'error', | ||
{ | ||
allowElseIf: false | ||
} | ||
], | ||
'no-empty-pattern': 'error', | ||
'no-eq-null': 'error', | ||
'no-eval': 'error', | ||
'no-extend-native': 'error', | ||
'no-extra-bind': 'error', | ||
'no-extra-label': 'error', | ||
'no-fallthrough': 'error', | ||
'no-floating-decimal': 'error', | ||
'no-global-assign': 'error', | ||
'no-implicit-coercion': 'error', | ||
'no-implicit-globals': 'error', | ||
'no-implied-eval': 'error', | ||
'no-iterator': 'error', | ||
'no-labels': 'error', | ||
'no-lone-blocks': 'error', | ||
'no-multi-spaces': 'error', | ||
'no-multi-str': 'error', | ||
'no-new-func': 'error', | ||
'no-new-wrappers': 'error', | ||
'no-nonoctal-decimal-escape': 'error', | ||
'no-new': 'error', | ||
'no-octal-escape': 'error', | ||
'no-octal': 'error', | ||
'no-proto': 'error', | ||
'no-redeclare': 'error', | ||
'no-return-assign': ['error', 'always'], | ||
'no-return-await': 'error', | ||
'no-script-url': 'error', | ||
'no-self-assign': [ | ||
'error', | ||
{ | ||
props: true | ||
} | ||
], | ||
'no-self-compare': 'error', | ||
'no-sequences': 'error', | ||
'no-throw-literal': 'error', | ||
'no-unmodified-loop-condition': 'error', | ||
'no-unused-expressions': [ | ||
'error', | ||
{ | ||
enforceForJSX: true | ||
} | ||
], | ||
'no-unused-labels': 'error', | ||
'no-useless-call': 'error', | ||
'no-useless-catch': 'error', | ||
'no-useless-concat': 'error', | ||
'no-useless-escape': 'error', | ||
'no-useless-return': 'error', | ||
'no-void': 'error', | ||
'no-warning-comments': 'warn', | ||
'no-with': 'error', | ||
// Disabled for now as Firefox doesn't support named capture groups and I'm tired of getting issues about the use of named capture groups... | ||
// 'prefer-named-capture-group': 'error' | ||
'prefer-promise-reject-errors': [ | ||
'error', | ||
{ | ||
allowEmptyReject: true | ||
} | ||
], | ||
'prefer-regex-literals': 'error', | ||
radix: 'error', | ||
// Disabled for now as it causes too much churn | ||
// TODO: Enable it in the future when I have time to deal with | ||
// the churn and the rule is stable and has an autofixer. | ||
// Still doesn't have a fixer as of ESLint 7.24.0. | ||
// 'require-unicode-regexp': 'error', | ||
'wrap-iife': [ | ||
'error', | ||
'inside', | ||
{ | ||
functionPrototypeMethods: true | ||
} | ||
], | ||
yoda: 'error', | ||
'no-delete-var': 'error', | ||
'no-label-var': 'error', | ||
'no-restricted-globals': ['error', 'event'], | ||
'no-shadow-restricted-names': 'error', | ||
'no-undef-init': 'error', | ||
'no-undef': [ | ||
'error', | ||
{ | ||
typeof: true | ||
} | ||
], | ||
'no-unused-vars': [ | ||
'error', | ||
{ | ||
vars: 'all', | ||
args: 'after-used', | ||
ignoreRestSiblings: true, | ||
argsIgnorePattern: /^_/.source, | ||
caughtErrors: 'all', | ||
caughtErrorsIgnorePattern: /^_$/.source | ||
} | ||
], | ||
'no-buffer-constructor': 'error', | ||
'no-restricted-imports': [ | ||
'error', | ||
'domain', | ||
'freelist', | ||
'smalloc', | ||
'punycode', | ||
'sys', | ||
'querystring', | ||
'colors' | ||
], | ||
'array-bracket-newline': ['error', 'consistent'], | ||
'array-bracket-spacing': ['error', 'never'], | ||
'array-element-newline': ['error', 'consistent'], | ||
'brace-style': [ | ||
'error', | ||
'1tbs', | ||
{ | ||
allowSingleLine: false | ||
} | ||
], | ||
'comma-spacing': [ | ||
'error', | ||
{ | ||
before: false, | ||
after: true | ||
} | ||
], | ||
'comma-style': ['error', 'last'], | ||
'computed-property-spacing': [ | ||
'error', | ||
'never', | ||
{ | ||
enforceForClassMembers: true | ||
} | ||
], | ||
'eol-last': 'error', | ||
'func-call-spacing': ['error', 'never'], | ||
'func-name-matching': [ | ||
'error', | ||
{ | ||
considerPropertyDescriptor: true | ||
} | ||
], | ||
'func-names': ['error', 'never'], | ||
'function-call-argument-newline': ['error', 'consistent'], | ||
'jsx-quotes': ['error', 'prefer-single'], | ||
'key-spacing': [ | ||
'error', | ||
{ | ||
beforeColon: false, | ||
afterColon: true | ||
} | ||
], | ||
'keyword-spacing': 'error', | ||
'linebreak-style': [process.platform === 'win32' ? 'off' : 'error', 'unix'], | ||
'lines-between-class-members': [ | ||
'error', | ||
'always', | ||
{ | ||
// Workaround to allow class fields to not have lines between them. | ||
// TODO: Get ESLint to add an option to ignore class fields. | ||
exceptAfterSingleLine: true | ||
} | ||
], | ||
'max-depth': 'warn', | ||
'max-nested-callbacks': ['warn', 4], | ||
'max-params': [ | ||
'warn', | ||
{ | ||
max: 4 | ||
} | ||
], | ||
'max-statements-per-line': 'error', | ||
'new-cap': [ | ||
'error', | ||
{ | ||
newIsCap: true, | ||
capIsNew: true | ||
} | ||
], | ||
'new-parens': 'error', | ||
'no-array-constructor': 'error', | ||
'no-bitwise': 'error', | ||
'no-lonely-if': 'error', | ||
'no-mixed-operators': 'error', | ||
'no-mixed-spaces-and-tabs': 'error', | ||
'no-multi-assign': 'error', | ||
'no-multiple-empty-lines': [ | ||
'error', | ||
{ | ||
max: 1 | ||
} | ||
], | ||
'no-negated-condition': 'error', | ||
'no-new-object': 'error', | ||
'no-whitespace-before-property': 'error', | ||
'no-trailing-spaces': 'error', | ||
'no-unneeded-ternary': 'error', | ||
'object-curly-spacing': ['error', 'always'], | ||
// Disabled because of https://github.com/xojs/eslint-config-xo/issues/27 | ||
// 'object-property-newline': 'error', | ||
'one-var': ['error', 'never'], | ||
'one-var-declaration-per-line': 'error', | ||
'operator-assignment': ['error', 'always'], | ||
'padded-blocks': [ | ||
'error', | ||
'never', | ||
{ | ||
allowSingleLineBlocks: false | ||
} | ||
], | ||
'padding-line-between-statements': [ | ||
'error', | ||
{ | ||
blankLine: 'always', | ||
prev: 'multiline-block-like', | ||
next: '*' | ||
} | ||
], | ||
'prefer-exponentiation-operator': 'error', | ||
'prefer-object-spread': 'error', | ||
'quote-props': ['error', 'as-needed'], | ||
'semi-spacing': [ | ||
'error', | ||
{ | ||
before: false, | ||
after: true | ||
} | ||
], | ||
'semi-style': ['error', 'last'], | ||
semi: ['error', 'always'], | ||
'space-before-blocks': ['error', 'always'], | ||
'space-before-function-paren': [ | ||
'error', | ||
{ | ||
anonymous: 'always', | ||
named: 'never', | ||
asyncArrow: 'always' | ||
} | ||
], | ||
'space-in-parens': ['error', 'never'], | ||
'space-infix-ops': 'error', | ||
'space-unary-ops': 'error', | ||
'spaced-comment': [ | ||
'error', | ||
'always', | ||
{ | ||
line: { | ||
exceptions: ['-', '+', '*'], | ||
markers: ['!', '/', '=>'] | ||
}, | ||
block: { | ||
exceptions: ['-', '+', '*'], | ||
markers: ['!', '*'], | ||
balanced: true | ||
} | ||
} | ||
], | ||
'switch-colon-spacing': [ | ||
'error', | ||
{ | ||
after: true, | ||
before: false | ||
} | ||
], | ||
'template-tag-spacing': ['error', 'never'], | ||
'unicode-bom': ['error', 'never'], | ||
'arrow-body-style': 'error', | ||
'arrow-spacing': [ | ||
'error', | ||
{ | ||
before: true, | ||
after: true | ||
} | ||
], | ||
'constructor-super': 'error', | ||
'generator-star-spacing': ['error', 'both'], | ||
'no-class-assign': 'error', | ||
'no-const-assign': 'error', | ||
'no-dupe-class-members': 'error', | ||
'no-new-symbol': 'error', | ||
'no-this-before-super': 'error', | ||
'no-useless-computed-key': [ | ||
'error', | ||
{ | ||
enforceForClassMembers: true | ||
} | ||
], | ||
'no-useless-constructor': 'error', | ||
'no-useless-rename': 'error', | ||
'no-var': 'error', | ||
'object-shorthand': [ | ||
'error', | ||
'always', | ||
{ | ||
avoidExplicitReturnArrows: true | ||
} | ||
], | ||
'prefer-arrow-callback': [ | ||
'error', | ||
{ | ||
allowNamedFunctions: true | ||
} | ||
], | ||
'prefer-const': [ | ||
'error', | ||
{ | ||
destructuring: 'all' | ||
} | ||
], | ||
'prefer-destructuring': [ | ||
'error', | ||
{ | ||
// `array` is disabled because it forces destructuring on | ||
// stupid stuff like `foo.bar = process.argv[2];` | ||
// TODO: Open ESLint issue about this | ||
VariableDeclarator: { | ||
array: false, | ||
object: true | ||
}, | ||
AssignmentExpression: { | ||
array: false, | ||
// Disabled because object assignment destructuring requires parens wrapping: | ||
// `let foo; ({foo} = object);` | ||
object: false | ||
} | ||
}, | ||
{ | ||
enforceForRenamedProperties: false | ||
} | ||
], | ||
'prefer-numeric-literals': 'error', | ||
// TODO: Enable when targeting Node.js 16. | ||
// 'prefer-object-has-own': 'error', | ||
'prefer-rest-params': 'error', | ||
'prefer-spread': 'error', | ||
'require-yield': 'error', | ||
'rest-spread-spacing': ['error', 'never'], | ||
'symbol-description': 'error', | ||
'template-curly-spacing': 'error', | ||
'yield-star-spacing': ['error', 'both'] | ||
} | ||
}; |
{ | ||
"name": "eslint-config-xo-lass", | ||
"description": "ESLint shareable config for Lass to be used with eslint-config-xo", | ||
"version": "1.0.6", | ||
"version": "2.0.1", | ||
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)", | ||
@@ -10,33 +10,22 @@ "bugs": { | ||
}, | ||
"commitlint": { | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
] | ||
}, | ||
"contributors": [ | ||
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)" | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@commitlint/cli": "latest", | ||
"@commitlint/config-conventional": "latest", | ||
"cross-env": "latest", | ||
"eslint": "latest", | ||
"eslint-config-prettier": "latest", | ||
"eslint-plugin-prettier": "latest", | ||
"fixpack": "latest", | ||
"husky": "latest", | ||
"lint-staged": "latest", | ||
"prettier": "latest", | ||
"remark-cli": "latest", | ||
"remark-preset-github": "latest", | ||
"xo": "latest" | ||
"@commitlint/cli": "^17.0.2", | ||
"@commitlint/config-conventional": "^17.0.2", | ||
"cross-env": "^7.0.3", | ||
"husky": "^8.0.1", | ||
"lint-staged": "^13.0.0", | ||
"remark-cli": "^10.0.1", | ||
"remark-preset-github": "^4.0.3", | ||
"xo": "^0.49.0" | ||
}, | ||
"engines": { | ||
"node": ">=14" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"homepage": "https://github.com/lassjs/eslint-config-xo-lass", | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged && npm test", | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
}, | ||
"keywords": [ | ||
@@ -52,28 +41,3 @@ "cabin", | ||
"license": "MIT", | ||
"lint-staged": { | ||
"*.js": [ | ||
"prettier --write", | ||
"xo --fix", | ||
"git add" | ||
], | ||
"*.md": [ | ||
"remark . -qfo", | ||
"git add" | ||
], | ||
"package.json": [ | ||
"fixpack", | ||
"git add" | ||
] | ||
}, | ||
"main": "index.js", | ||
"prettier": { | ||
"singleQuote": true, | ||
"bracketSpacing": true, | ||
"trailingComma": "none" | ||
}, | ||
"remarkConfig": { | ||
"plugins": [ | ||
"preset-github" | ||
] | ||
}, | ||
"repository": { | ||
@@ -84,30 +48,6 @@ "type": "git", | ||
"scripts": { | ||
"lint": "xo && remark . -qfo", | ||
"lint": "xo --fix && remark . -qfo && fixpack", | ||
"prepare": "husky install", | ||
"test": "npm run lint" | ||
}, | ||
"xo": { | ||
"prettier": true, | ||
"space": true, | ||
"parserOptions": { | ||
"sourceType": "script" | ||
}, | ||
"rules": { | ||
"max-len": [ | ||
"error", | ||
{ | ||
"code": 80, | ||
"ignoreUrls": true | ||
} | ||
], | ||
"unicorn/catch-error-name": [ | ||
"error", | ||
{ | ||
"name": "err" | ||
} | ||
], | ||
"capitalized-comments": "off", | ||
"camelcase": "off", | ||
"no-warning-comments": "off" | ||
} | ||
} | ||
} |
@@ -27,9 +27,3 @@ # eslint-config-xo-lass | ||
[yarn][]: | ||
```sh | ||
yarn add -D eslint-config-xo-lass | ||
``` | ||
## Usage | ||
@@ -56,4 +50,2 @@ | ||
[yarn]: https://yarnpkg.com/ | ||
[shareable-config]: http://eslint.org/docs/developer-guide/shareable-configs.html | ||
@@ -60,0 +52,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
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
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
15596
8
463
4
54
1