diff --git a/.eslintrc.json b/.eslintrc.json index c2c262d..6504a9c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,5 +2,5 @@ "env": { "node": true }, - "extends": ["./index.js"] + "extends": ["./config.js"] } diff --git a/README.md b/README.md index 59a9dc7..7eaaa08 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# simple-icons-eslint +# eslint-config-simple-icons -[![Build status](https://img.shields.io/github/workflow/status/simple-icons/simple-icons-eslint/Verify/develop?logo=github&label=tests)](https://github.com/simple-icons/simple-icons-eslint/actions?query=workflow%3AVerify+branch%develop) [![NPM version](https://img.shields.io/npm/v/simple-icons-eslint.svg?logo=npm)](https://www.npmjs.com/package/simple-icons-eslint) +[![Build status](https://img.shields.io/github/workflow/status/simple-icons/simple-icons-eslint/Verify/develop?logo=github&label=tests)](https://github.com/simple-icons/simple-icons-eslint/actions?query=workflow%3AVerify+branch%develop) [![NPM version](https://img.shields.io/npm/v/simple-icons-eslint.svg?logo=npm)](https://www.npmjs.com/package/eslint-config-simple-icons) Simple Icons ESLint base configuration for all repositories. @@ -11,7 +11,7 @@ Is a configuration based on [`eslint:recommended`](https://github.com/eslint/esl Install the package: ```sh -npm install -DE simple-icons-eslint +npm install -DE eslint-config-simple-icons ``` Add `simple-icons-eslint` to the `extends` array of the _.eslintrc.json_ file: diff --git a/config.js b/config.js new file mode 100644 index 0000000..870dd2a --- /dev/null +++ b/config.js @@ -0,0 +1,172 @@ +module.exports = { + rules: { + "constructor-super": "error", + "for-direction": "error", + "getter-return": "error", + "no-async-promise-executor": "error", + "no-case-declarations": "error", + "no-class-assign": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", + "no-const-assign": "error", + "no-constant-condition": "error", + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-else-if": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-empty": "error", + "no-empty-character-class": "error", + "no-empty-pattern": "error", + "no-ex-assign": "error", + "no-extra-boolean-cast": "error", + "no-fallthrough": "error", + "no-func-assign": "error", + "no-global-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-new-symbol": "error", + "no-nonoctal-decimal-escape": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-prototype-builtins": "error", + "no-redeclare": "error", + "no-regex-spaces": "error", + "no-self-assign": "error", + "no-setter-return": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-this-before-super": "error", + "no-undef": "error", + "no-unreachable": "error", + "no-unsafe-finally": "error", + "no-unsafe-negation": "error", + "no-unsafe-optional-chaining": "error", + "no-unused-labels": "error", + "no-useless-backreference": "error", + "no-useless-catch": "error", + "no-useless-escape": "error", + "no-with": "error", + "require-yield": "error", + "use-isnan": "error", + "valid-typeof": "error", + + "no-console": ["error", { allow: ["error", "info"] }], + "no-unused-vars": ["error", { varsIgnorePattern: "^_$" }], + "no-duplicate-imports": "error", + "no-constructor-return": "error", + "no-template-curly-in-string": "error", + "no-unreachable-loop": "error", + "no-use-before-define": "error", + "default-case-last": "error", + eqeqeq: "error", + "dot-notation": "error", + "max-lines": ["error", { max: 1000 }], + "no-alert": "error", + "no-eval": "error", + "no-extend-native": "error", + "no-inline-comments": "error", + "no-lonely-if": "error", + "no-shadow": "error", + "no-useless-call": "error", + "no-useless-concat": "error", + "no-var": "error", + "one-var": ["error", "never"], + "prefer-const": "error", + "prefer-object-has-own": "error", + "require-await": "error", + "spaced-comment": "error", + yoda: "error", + + // The rest are rules that you never need to enable when using Prettier. + curly: 0, + "lines-around-comment": 0, + "max-len": 0, + "no-confusing-arrow": 0, + "no-mixed-operators": 0, + "no-tabs": 0, + "no-unexpected-multiline": 0, + quotes: 0, + + "arrow-body-style": "off", + "prefer-arrow-callback": "off", + "array-bracket-newline": "off", + "array-bracket-spacing": "off", + "array-element-newline": "off", + "arrow-parens": "off", + "arrow-spacing": "off", + "block-spacing": "off", + "brace-style": "off", + "comma-dangle": "off", + "comma-spacing": "off", + "comma-style": "off", + "computed-property-spacing": "off", + "dot-location": "off", + "eol-last": "off", + "func-call-spacing": "off", + "function-call-argument-newline": "off", + "function-paren-newline": "off", + "generator-star": "off", + "generator-star-spacing": "off", + "implicit-arrow-linebreak": "off", + indent: "off", + "jsx-quotes": "off", + "key-spacing": "off", + "keyword-spacing": "off", + "linebreak-style": "off", + "multiline-ternary": "off", + "newline-per-chained-call": "off", + "new-parens": "off", + "no-arrow-condition": "off", + "no-comma-dangle": "off", + "no-extra-parens": "off", + "no-extra-semi": "off", + "no-floating-decimal": "off", + "no-mixed-spaces-and-tabs": "off", + "no-multi-spaces": "off", + "no-multiple-empty-lines": "off", + "no-reserved-keys": "off", + "no-space-before-semi": "off", + "no-trailing-spaces": "off", + "no-whitespace-before-property": "off", + "no-wrap-func": "off", + "nonblock-statement-body-position": "off", + "object-curly-newline": "off", + "object-curly-spacing": "off", + "object-property-newline": "off", + "one-var-declaration-per-line": "off", + "operator-linebreak": "off", + "padded-blocks": "off", + "quote-props": "off", + "rest-spread-spacing": "off", + semi: "off", + "semi-spacing": "off", + "semi-style": "off", + "space-after-function-name": "off", + "space-after-keywords": "off", + "space-before-blocks": "off", + "space-before-function-paren": "off", + "space-before-function-parentheses": "off", + "space-before-keywords": "off", + "space-in-brackets": "off", + "space-in-parens": "off", + "space-infix-ops": "off", + "space-return-throw-case": "off", + "space-unary-ops": "off", + "space-unary-word-ops": "off", + "switch-colon-spacing": "off", + "template-curly-spacing": "off", + "template-tag-spacing": "off", + "unicode-bom": "off", + "wrap-iife": "off", + "wrap-regex": "off", + "yield-star-spacing": "off", + }, +}; diff --git a/index.js b/index.js index 870dd2a..4e397b1 100644 --- a/index.js +++ b/index.js @@ -1,172 +1 @@ -module.exports = { - rules: { - "constructor-super": "error", - "for-direction": "error", - "getter-return": "error", - "no-async-promise-executor": "error", - "no-case-declarations": "error", - "no-class-assign": "error", - "no-compare-neg-zero": "error", - "no-cond-assign": "error", - "no-const-assign": "error", - "no-constant-condition": "error", - "no-control-regex": "error", - "no-debugger": "error", - "no-delete-var": "error", - "no-dupe-args": "error", - "no-dupe-class-members": "error", - "no-dupe-else-if": "error", - "no-dupe-keys": "error", - "no-duplicate-case": "error", - "no-empty": "error", - "no-empty-character-class": "error", - "no-empty-pattern": "error", - "no-ex-assign": "error", - "no-extra-boolean-cast": "error", - "no-fallthrough": "error", - "no-func-assign": "error", - "no-global-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-new-symbol": "error", - "no-nonoctal-decimal-escape": "error", - "no-obj-calls": "error", - "no-octal": "error", - "no-prototype-builtins": "error", - "no-redeclare": "error", - "no-regex-spaces": "error", - "no-self-assign": "error", - "no-setter-return": "error", - "no-shadow-restricted-names": "error", - "no-sparse-arrays": "error", - "no-this-before-super": "error", - "no-undef": "error", - "no-unreachable": "error", - "no-unsafe-finally": "error", - "no-unsafe-negation": "error", - "no-unsafe-optional-chaining": "error", - "no-unused-labels": "error", - "no-useless-backreference": "error", - "no-useless-catch": "error", - "no-useless-escape": "error", - "no-with": "error", - "require-yield": "error", - "use-isnan": "error", - "valid-typeof": "error", - - "no-console": ["error", { allow: ["error", "info"] }], - "no-unused-vars": ["error", { varsIgnorePattern: "^_$" }], - "no-duplicate-imports": "error", - "no-constructor-return": "error", - "no-template-curly-in-string": "error", - "no-unreachable-loop": "error", - "no-use-before-define": "error", - "default-case-last": "error", - eqeqeq: "error", - "dot-notation": "error", - "max-lines": ["error", { max: 1000 }], - "no-alert": "error", - "no-eval": "error", - "no-extend-native": "error", - "no-inline-comments": "error", - "no-lonely-if": "error", - "no-shadow": "error", - "no-useless-call": "error", - "no-useless-concat": "error", - "no-var": "error", - "one-var": ["error", "never"], - "prefer-const": "error", - "prefer-object-has-own": "error", - "require-await": "error", - "spaced-comment": "error", - yoda: "error", - - // The rest are rules that you never need to enable when using Prettier. - curly: 0, - "lines-around-comment": 0, - "max-len": 0, - "no-confusing-arrow": 0, - "no-mixed-operators": 0, - "no-tabs": 0, - "no-unexpected-multiline": 0, - quotes: 0, - - "arrow-body-style": "off", - "prefer-arrow-callback": "off", - "array-bracket-newline": "off", - "array-bracket-spacing": "off", - "array-element-newline": "off", - "arrow-parens": "off", - "arrow-spacing": "off", - "block-spacing": "off", - "brace-style": "off", - "comma-dangle": "off", - "comma-spacing": "off", - "comma-style": "off", - "computed-property-spacing": "off", - "dot-location": "off", - "eol-last": "off", - "func-call-spacing": "off", - "function-call-argument-newline": "off", - "function-paren-newline": "off", - "generator-star": "off", - "generator-star-spacing": "off", - "implicit-arrow-linebreak": "off", - indent: "off", - "jsx-quotes": "off", - "key-spacing": "off", - "keyword-spacing": "off", - "linebreak-style": "off", - "multiline-ternary": "off", - "newline-per-chained-call": "off", - "new-parens": "off", - "no-arrow-condition": "off", - "no-comma-dangle": "off", - "no-extra-parens": "off", - "no-extra-semi": "off", - "no-floating-decimal": "off", - "no-mixed-spaces-and-tabs": "off", - "no-multi-spaces": "off", - "no-multiple-empty-lines": "off", - "no-reserved-keys": "off", - "no-space-before-semi": "off", - "no-trailing-spaces": "off", - "no-whitespace-before-property": "off", - "no-wrap-func": "off", - "nonblock-statement-body-position": "off", - "object-curly-newline": "off", - "object-curly-spacing": "off", - "object-property-newline": "off", - "one-var-declaration-per-line": "off", - "operator-linebreak": "off", - "padded-blocks": "off", - "quote-props": "off", - "rest-spread-spacing": "off", - semi: "off", - "semi-spacing": "off", - "semi-style": "off", - "space-after-function-name": "off", - "space-after-keywords": "off", - "space-before-blocks": "off", - "space-before-function-paren": "off", - "space-before-function-parentheses": "off", - "space-before-keywords": "off", - "space-in-brackets": "off", - "space-in-parens": "off", - "space-infix-ops": "off", - "space-return-throw-case": "off", - "space-unary-ops": "off", - "space-unary-word-ops": "off", - "switch-colon-spacing": "off", - "template-curly-spacing": "off", - "template-tag-spacing": "off", - "unicode-bom": "off", - "wrap-iife": "off", - "wrap-regex": "off", - "yield-star-spacing": "off", - }, -}; +module.exports = require("./config.js"); diff --git a/package.json b/package.json index c6aa1fa..474c4de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "simple-icons-eslint", - "version": "0.1.1", + "name": "eslint-config-simple-icons", + "version": "0.1.0", "description": "Simple Icons ESLint base configuration for all repositories", "homepage": "https://simpleicons.org", "main": "index.js", @@ -12,10 +12,14 @@ }, "keywords": [ "eslint", + "eslintconfig", "simple-icons" ], "author": "Simple Icons Collaborators", "license": "CC0-1.0", + "peerDependencies": { + "eslint": ">= 3" + }, "devDependencies": { "eslint": "8.24.0", "eslint-config-prettier": "8.5.0",