@omer-x/eslint-config 1.0.7 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -10
- package/dist/base.d.ts +3 -0
- package/dist/base.js +27 -0
- package/dist/import.d.ts +3 -0
- package/dist/import.js +20 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +16 -0
- package/dist/jsx-a11y.d.ts +3 -0
- package/dist/jsx-a11y.js +9 -0
- package/dist/react.d.ts +3 -0
- package/dist/react.js +27 -0
- package/dist/stylistic.d.ts +3 -0
- package/dist/stylistic.js +123 -0
- package/dist/typescript.d.ts +3 -0
- package/dist/typescript.js +37 -0
- package/dist/unused-imports.d.ts +3 -0
- package/dist/unused-imports.js +15 -0
- package/package.json +67 -18
- package/base.js +0 -26
- package/index.js +0 -31
- package/jsx.js +0 -11
- package/stylistic.js +0 -120
- package/typescript.js +0 -31
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# @omer-x/eslint-config
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@omer-x/eslint-config)
|
|
4
|
+
[](https://www.npmjs.com/package/@omer-x/eslint-config)
|
|
5
|
+
[](https://codecov.io/gh/omermecitoglu/eslint-config)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://github.com/omermecitoglu/eslint-config/commits/main/)
|
|
8
|
+
[](https://github.com/omermecitoglu/eslint-config/issues)
|
|
9
|
+
[](https://github.com/omermecitoglu/eslint-config)
|
|
4
10
|
|
|
5
11
|
This package contains my favorite ESLint rules, created following [this tutorial](https://eslint.org/docs/latest/extend/shareable-configs) on ESLint's shareable configs.
|
|
6
12
|
|
|
@@ -14,20 +20,50 @@ npm install @omer-x/eslint-config --save-dev
|
|
|
14
20
|
|
|
15
21
|
Ensure you have the following peer dependencies installed:
|
|
16
22
|
|
|
17
|
-
- `eslint >=
|
|
23
|
+
- `eslint >= 9`
|
|
18
24
|
|
|
19
25
|
## Usage
|
|
20
26
|
|
|
21
|
-
Add the configuration to your ESLint configuration file (e.g.,
|
|
27
|
+
Add the configuration to your ESLint configuration file (e.g., `eslint.config.js` or `eslint.config.mjs`):
|
|
22
28
|
|
|
23
29
|
```javascript
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
import omer from "@omer-x/eslint-config";
|
|
31
|
+
|
|
32
|
+
export default [
|
|
33
|
+
...omer,
|
|
34
|
+
{
|
|
35
|
+
rules: {
|
|
36
|
+
// add your other rules here
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Or you can install components individually
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
import base from "@omer-x/eslint-config/base";
|
|
46
|
+
import stylistic from "@omer-x/eslint-config/stylistic";
|
|
47
|
+
import typescript from "@omer-x/eslint-config/typescript";
|
|
48
|
+
import react from "@omer-x/eslint-config/react";
|
|
49
|
+
import jsxAccessibility from "@omer-x/eslint-config/jsx-a11y";
|
|
50
|
+
import importPlugin from "@omer-x/eslint-config/import";
|
|
51
|
+
import unusedImports from "@omer-x/eslint-config/unused-imports";
|
|
52
|
+
|
|
53
|
+
export default [
|
|
54
|
+
...base,
|
|
55
|
+
...stylistic,
|
|
56
|
+
...typescript,
|
|
57
|
+
...react,
|
|
58
|
+
...jsxAccessibility,
|
|
59
|
+
...importPlugin,
|
|
60
|
+
...unusedImports,
|
|
61
|
+
{
|
|
62
|
+
rules: {
|
|
63
|
+
// add your other rules here
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
];
|
|
31
67
|
```
|
|
32
68
|
|
|
33
69
|
## License
|
package/dist/base.d.ts
ADDED
package/dist/base.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import eslint from "@eslint/js";
|
|
2
|
+
export default [
|
|
3
|
+
eslint.configs.recommended,
|
|
4
|
+
{
|
|
5
|
+
rules: {
|
|
6
|
+
"array-callback-return": "error",
|
|
7
|
+
"class-methods-use-this": "error",
|
|
8
|
+
"curly": ["error", "multi-line", "consistent"],
|
|
9
|
+
"dot-notation": "error",
|
|
10
|
+
"eqeqeq": "error",
|
|
11
|
+
"line-comment-position": "off",
|
|
12
|
+
"max-nested-callbacks": ["error", { max: 4 }],
|
|
13
|
+
"max-statements-per-line": ["error", { max: 2 }],
|
|
14
|
+
"no-console": "warn",
|
|
15
|
+
"no-duplicate-imports": "error",
|
|
16
|
+
"no-empty-function": "error",
|
|
17
|
+
"no-lonely-if": "error",
|
|
18
|
+
"no-shadow": ["error", { allow: ["err", "resolve", "reject"] }],
|
|
19
|
+
"no-var": "error",
|
|
20
|
+
"prefer-const": "error",
|
|
21
|
+
"require-await": "warn",
|
|
22
|
+
"sort-imports": ["error", { ignoreDeclarationSort: true }],
|
|
23
|
+
"unicode-bom": ["error", "never"],
|
|
24
|
+
"yoda": "error",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
];
|
package/dist/import.d.ts
ADDED
package/dist/import.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import importPlugin from "eslint-plugin-import";
|
|
2
|
+
export default [
|
|
3
|
+
{
|
|
4
|
+
plugins: {
|
|
5
|
+
import: importPlugin,
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
"import/order": ["error", {
|
|
9
|
+
alphabetize: {
|
|
10
|
+
caseInsensitive: false,
|
|
11
|
+
order: "asc",
|
|
12
|
+
},
|
|
13
|
+
groups: ["builtin", "external", "internal", "parent", "sibling", "index", "type", "object"],
|
|
14
|
+
pathGroups: [
|
|
15
|
+
{ group: "internal", pattern: "~/**" },
|
|
16
|
+
],
|
|
17
|
+
}],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
];
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import base from "./base.js";
|
|
2
|
+
import importPlugin from "./import.js";
|
|
3
|
+
import jsxAccessibility from "./jsx-a11y.js";
|
|
4
|
+
import react from "./react.js";
|
|
5
|
+
import stylistic from "./stylistic.js";
|
|
6
|
+
import typescript from "./typescript.js";
|
|
7
|
+
import unusedImports from "./unused-imports.js";
|
|
8
|
+
export default [
|
|
9
|
+
...base,
|
|
10
|
+
...stylistic,
|
|
11
|
+
...typescript,
|
|
12
|
+
...react,
|
|
13
|
+
...jsxAccessibility,
|
|
14
|
+
...importPlugin,
|
|
15
|
+
...unusedImports,
|
|
16
|
+
];
|
package/dist/jsx-a11y.js
ADDED
package/dist/react.d.ts
ADDED
package/dist/react.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import react from "eslint-plugin-react";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
export default [
|
|
4
|
+
{
|
|
5
|
+
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
6
|
+
languageOptions: {
|
|
7
|
+
globals: {
|
|
8
|
+
...globals.browser,
|
|
9
|
+
},
|
|
10
|
+
parserOptions: {
|
|
11
|
+
ecmaFeatures: {
|
|
12
|
+
jsx: true,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
plugins: {
|
|
17
|
+
react,
|
|
18
|
+
},
|
|
19
|
+
rules: {
|
|
20
|
+
"react/jsx-no-literals": ["error", {
|
|
21
|
+
allowedStrings: [
|
|
22
|
+
"©",
|
|
23
|
+
],
|
|
24
|
+
}],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
];
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import stylistic from "@stylistic/eslint-plugin";
|
|
2
|
+
export default [
|
|
3
|
+
{
|
|
4
|
+
plugins: {
|
|
5
|
+
"@stylistic": stylistic,
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
"@stylistic/array-bracket-newline": ["error", "consistent"],
|
|
9
|
+
"@stylistic/array-bracket-spacing": ["error", "never"],
|
|
10
|
+
"@stylistic/array-element-newline": ["error", "consistent"],
|
|
11
|
+
"@stylistic/arrow-parens": ["error", "as-needed"],
|
|
12
|
+
"@stylistic/arrow-spacing": ["warn", { after: true, before: true }],
|
|
13
|
+
"@stylistic/block-spacing": ["error", "always"],
|
|
14
|
+
"@stylistic/brace-style": ["error", "1tbs"],
|
|
15
|
+
"@stylistic/comma-dangle": ["error", "always-multiline"],
|
|
16
|
+
"@stylistic/comma-spacing": ["error", { after: true, before: false }],
|
|
17
|
+
"@stylistic/comma-style": "error",
|
|
18
|
+
"@stylistic/computed-property-spacing": ["error", "never"],
|
|
19
|
+
"@stylistic/dot-location": ["error", "property"],
|
|
20
|
+
"@stylistic/eol-last": ["error", "always"],
|
|
21
|
+
"@stylistic/function-call-argument-newline": ["error", "consistent"],
|
|
22
|
+
"@stylistic/function-call-spacing": ["error", "never"],
|
|
23
|
+
"@stylistic/function-paren-newline": ["error", "multiline"],
|
|
24
|
+
"@stylistic/generator-star-spacing": ["error", "both"],
|
|
25
|
+
"@stylistic/implicit-arrow-linebreak": ["error", "beside"],
|
|
26
|
+
"@stylistic/indent": ["error", 2, { SwitchCase: 1 }],
|
|
27
|
+
"@stylistic/indent-binary-ops": "error",
|
|
28
|
+
"@stylistic/jsx-child-element-spacing": "error",
|
|
29
|
+
"@stylistic/jsx-closing-bracket-location": ["error", "tag-aligned"],
|
|
30
|
+
"@stylistic/jsx-closing-tag-location": "error",
|
|
31
|
+
"@stylistic/jsx-curly-brace-presence": ["error", {
|
|
32
|
+
children: "never",
|
|
33
|
+
propElementValues: "always",
|
|
34
|
+
props: "never",
|
|
35
|
+
}],
|
|
36
|
+
"@stylistic/jsx-curly-newline": ["error", {
|
|
37
|
+
multiline: "consistent",
|
|
38
|
+
singleline: "consistent",
|
|
39
|
+
}],
|
|
40
|
+
"@stylistic/jsx-curly-spacing": ["error", { when: "never" }],
|
|
41
|
+
"@stylistic/jsx-equals-spacing": ["error", "never"],
|
|
42
|
+
"@stylistic/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
|
|
43
|
+
"@stylistic/jsx-indent": ["error", 2],
|
|
44
|
+
"@stylistic/jsx-indent-props": ["error", 2],
|
|
45
|
+
"@stylistic/jsx-max-props-per-line": ["error", { maximum: { multi: 1, single: 4 } }],
|
|
46
|
+
"@stylistic/jsx-newline": ["error", { allowMultilines: false, prevent: true }],
|
|
47
|
+
"@stylistic/jsx-one-expression-per-line": ["error", { allow: "single-child" }],
|
|
48
|
+
"@stylistic/jsx-props-no-multi-spaces": "error",
|
|
49
|
+
"@stylistic/jsx-quotes": ["error", "prefer-double"],
|
|
50
|
+
"@stylistic/jsx-self-closing-comp": ["error", { component: true, html: true }],
|
|
51
|
+
"@stylistic/jsx-sort-props": "off",
|
|
52
|
+
"@stylistic/jsx-tag-spacing": "error",
|
|
53
|
+
"@stylistic/jsx-wrap-multilines": ["error", {
|
|
54
|
+
arrow: "parens-new-line",
|
|
55
|
+
assignment: "parens-new-line",
|
|
56
|
+
condition: "parens-new-line",
|
|
57
|
+
declaration: "parens-new-line",
|
|
58
|
+
logical: "parens-new-line",
|
|
59
|
+
prop: "parens-new-line",
|
|
60
|
+
return: "parens-new-line",
|
|
61
|
+
}],
|
|
62
|
+
"@stylistic/key-spacing": "error",
|
|
63
|
+
"@stylistic/keyword-spacing": "error",
|
|
64
|
+
"@stylistic/linebreak-style": ["error", "unix"],
|
|
65
|
+
"@stylistic/lines-around-comment": "off",
|
|
66
|
+
"@stylistic/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
|
|
67
|
+
"@stylistic/max-len": ["warn", { code: 128 }],
|
|
68
|
+
"@stylistic/max-statements-per-line": ["error", { max: 1 }],
|
|
69
|
+
"@stylistic/member-delimiter-style": ["error", {
|
|
70
|
+
multiline: { delimiter: "comma", requireLast: true },
|
|
71
|
+
multilineDetection: "brackets",
|
|
72
|
+
singleline: { delimiter: "comma", requireLast: false },
|
|
73
|
+
}],
|
|
74
|
+
"@stylistic/multiline-ternary": "off",
|
|
75
|
+
"@stylistic/new-parens": ["error", "always"],
|
|
76
|
+
"@stylistic/newline-per-chained-call": ["error", { ignoreChainWithDepth: 3 }],
|
|
77
|
+
"@stylistic/no-confusing-arrow": "error",
|
|
78
|
+
"@stylistic/no-extra-parens": "off",
|
|
79
|
+
"@stylistic/no-extra-semi": "error",
|
|
80
|
+
"@stylistic/no-floating-decimal": "error",
|
|
81
|
+
"@stylistic/no-mixed-operators": "error",
|
|
82
|
+
"@stylistic/no-mixed-spaces-and-tabs": "error",
|
|
83
|
+
"@stylistic/no-multi-spaces": "error",
|
|
84
|
+
"@stylistic/no-multiple-empty-lines": ["error", { max: 2, maxBOF: 0, maxEOF: 1 }],
|
|
85
|
+
"@stylistic/no-tabs": "error",
|
|
86
|
+
"@stylistic/no-trailing-spaces": "error",
|
|
87
|
+
"@stylistic/no-whitespace-before-property": "error",
|
|
88
|
+
"@stylistic/nonblock-statement-body-position": ["error", "beside"],
|
|
89
|
+
"@stylistic/object-curly-newline": "error",
|
|
90
|
+
"@stylistic/object-curly-spacing": ["error", "always"],
|
|
91
|
+
"@stylistic/object-property-newline": "off",
|
|
92
|
+
"@stylistic/one-var-declaration-per-line": ["error", "initializations"],
|
|
93
|
+
"@stylistic/operator-linebreak": "error",
|
|
94
|
+
"@stylistic/padded-blocks": ["error", "never"],
|
|
95
|
+
"@stylistic/padding-line-between-statements": "error",
|
|
96
|
+
"@stylistic/quote-props": ["error", "consistent-as-needed"],
|
|
97
|
+
"@stylistic/quotes": ["error", "double", { avoidEscape: true }],
|
|
98
|
+
"@stylistic/rest-spread-spacing": ["error", "never"],
|
|
99
|
+
"@stylistic/semi": ["error", "always"],
|
|
100
|
+
"@stylistic/semi-spacing": ["error", { after: true, before: false }],
|
|
101
|
+
"@stylistic/semi-style": "error",
|
|
102
|
+
"@stylistic/space-before-blocks": "error",
|
|
103
|
+
"@stylistic/space-before-function-paren": ["error", {
|
|
104
|
+
anonymous: "never",
|
|
105
|
+
asyncArrow: "always",
|
|
106
|
+
named: "never",
|
|
107
|
+
}],
|
|
108
|
+
"@stylistic/space-in-parens": "error",
|
|
109
|
+
"@stylistic/space-infix-ops": "error",
|
|
110
|
+
"@stylistic/space-unary-ops": "error",
|
|
111
|
+
"@stylistic/spaced-comment": "error",
|
|
112
|
+
"@stylistic/switch-colon-spacing": ["error", { after: true, before: false }],
|
|
113
|
+
"@stylistic/template-curly-spacing": ["error", "never"],
|
|
114
|
+
"@stylistic/template-tag-spacing": ["error", "never"],
|
|
115
|
+
"@stylistic/type-annotation-spacing": "error",
|
|
116
|
+
"@stylistic/type-generic-spacing": "error",
|
|
117
|
+
"@stylistic/type-named-tuple-spacing": "error",
|
|
118
|
+
"@stylistic/wrap-iife": ["error", "outside"],
|
|
119
|
+
"@stylistic/wrap-regex": "error",
|
|
120
|
+
"@stylistic/yield-star-spacing": ["error", "both"],
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import parser from "@typescript-eslint/parser";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
export default [
|
|
4
|
+
...tseslint.configs.recommended,
|
|
5
|
+
{
|
|
6
|
+
files: ["**/*.ts"],
|
|
7
|
+
languageOptions: {
|
|
8
|
+
parser,
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: "./tsconfig.json",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
15
|
+
"@typescript-eslint/array-type": "error",
|
|
16
|
+
"@typescript-eslint/ban-ts-comment": "warn",
|
|
17
|
+
"@typescript-eslint/ban-tslint-comment": "warn",
|
|
18
|
+
"@typescript-eslint/class-methods-use-this": "error",
|
|
19
|
+
"@typescript-eslint/consistent-indexed-object-style": "error",
|
|
20
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
21
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
22
|
+
"@typescript-eslint/dot-notation": "error",
|
|
23
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
|
24
|
+
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
25
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
26
|
+
"@typescript-eslint/prefer-includes": "error",
|
|
27
|
+
"@typescript-eslint/prefer-nullish-coalescing": ["error", {
|
|
28
|
+
ignorePrimitives: {
|
|
29
|
+
string: true,
|
|
30
|
+
},
|
|
31
|
+
}],
|
|
32
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
33
|
+
"class-methods-use-this": "off",
|
|
34
|
+
"dot-notation": "off",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import unusedImports from "eslint-plugin-unused-imports";
|
|
2
|
+
export default [
|
|
3
|
+
{
|
|
4
|
+
plugins: {
|
|
5
|
+
"unused-imports": unusedImports,
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
"unused-imports/no-unused-imports": "error",
|
|
9
|
+
"unused-imports/no-unused-vars": [
|
|
10
|
+
"warn",
|
|
11
|
+
{ args: "after-used", argsIgnorePattern: "^_", vars: "all", varsIgnorePattern: "^_" },
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
];
|
package/package.json
CHANGED
|
@@ -1,39 +1,88 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omer-x/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "My favorite eslint rules",
|
|
5
|
-
"author": "Omer Mecitoglu",
|
|
6
|
-
"license": "MIT",
|
|
7
5
|
"keywords": [
|
|
8
|
-
"eslint",
|
|
9
|
-
"config"
|
|
6
|
+
"eslint-config",
|
|
7
|
+
"shareable-config"
|
|
10
8
|
],
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/omermecitoglu/eslint-config.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/omermecitoglu/eslint-config/issues"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/omermecitoglu/eslint-config#readme",
|
|
11
17
|
"private": false,
|
|
12
18
|
"publishConfig": {
|
|
13
19
|
"access": "public"
|
|
14
20
|
},
|
|
15
|
-
"
|
|
21
|
+
"author": {
|
|
22
|
+
"name": "Omer Mecitoglu",
|
|
23
|
+
"email": "omer.mecitoglu@gmail.com",
|
|
24
|
+
"url": "https://omermecitoglu.github.io"
|
|
25
|
+
},
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"import": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts"
|
|
33
|
+
},
|
|
34
|
+
"./base": {
|
|
35
|
+
"import": "./dist/base.js",
|
|
36
|
+
"types": "./dist/base.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./stylistic": {
|
|
39
|
+
"import": "./dist/stylistic.js",
|
|
40
|
+
"types": "./dist/stylistic.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./typescript": {
|
|
43
|
+
"import": "./dist/typescript.js",
|
|
44
|
+
"types": "./dist/typescript.d.ts"
|
|
45
|
+
},
|
|
46
|
+
"./react": {
|
|
47
|
+
"import": "./dist/react.js",
|
|
48
|
+
"types": "./dist/react.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./jsx-a11y": {
|
|
51
|
+
"import": "./dist/jsx-a11y.js",
|
|
52
|
+
"types": "./dist/jsx-a11y.d.ts"
|
|
53
|
+
},
|
|
54
|
+
"./import": {
|
|
55
|
+
"import": "./dist/import.js",
|
|
56
|
+
"types": "./dist/import.d.ts"
|
|
57
|
+
},
|
|
58
|
+
"./unused-imports": {
|
|
59
|
+
"import": "./dist/unused-imports.js",
|
|
60
|
+
"types": "./dist/unused-imports.d.ts"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
16
63
|
"files": [
|
|
17
|
-
"
|
|
18
|
-
"index.js",
|
|
19
|
-
"jsx.js",
|
|
20
|
-
"stylistic.js",
|
|
21
|
-
"typescript.js"
|
|
64
|
+
"dist/"
|
|
22
65
|
],
|
|
23
66
|
"scripts": {
|
|
67
|
+
"build": "tsc",
|
|
24
68
|
"lint": "eslint"
|
|
25
69
|
},
|
|
26
70
|
"peerDependencies": {
|
|
27
|
-
"eslint": ">=
|
|
71
|
+
"eslint": ">= 9"
|
|
28
72
|
},
|
|
29
73
|
"dependencies": {
|
|
30
|
-
"@stylistic/eslint-plugin": "^
|
|
31
|
-
"@typescript-eslint/
|
|
32
|
-
"eslint-plugin-import": "^2.
|
|
33
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
34
|
-
"eslint-plugin-
|
|
74
|
+
"@stylistic/eslint-plugin": "^2.8.0",
|
|
75
|
+
"@typescript-eslint/parser": "^8.8.0",
|
|
76
|
+
"eslint-plugin-import": "^2.31.0",
|
|
77
|
+
"eslint-plugin-jsx-a11y": "^6.10.0",
|
|
78
|
+
"eslint-plugin-react": "^7.37.1",
|
|
79
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
80
|
+
"typescript-eslint": "^8.8.0"
|
|
35
81
|
},
|
|
36
82
|
"devDependencies": {
|
|
37
|
-
"
|
|
83
|
+
"@types/eslint__js": "^8.42.3",
|
|
84
|
+
"@types/eslint-plugin-jsx-a11y": "^6.9.0",
|
|
85
|
+
"eslint": "^9.11.1",
|
|
86
|
+
"typescript": "^5.6.2"
|
|
38
87
|
}
|
|
39
88
|
}
|
package/base.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
"eslint:recommended",
|
|
4
|
-
],
|
|
5
|
-
rules: {
|
|
6
|
-
"array-callback-return": "error",
|
|
7
|
-
"class-methods-use-this": "error",
|
|
8
|
-
"curly": ["error", "multi-line", "consistent"],
|
|
9
|
-
"dot-notation": "error",
|
|
10
|
-
"eqeqeq": "error",
|
|
11
|
-
"line-comment-position": "off",
|
|
12
|
-
"max-nested-callbacks": ["error", { max: 4 }],
|
|
13
|
-
"max-statements-per-line": ["error", { max: 2 }],
|
|
14
|
-
"no-console": "warn",
|
|
15
|
-
"no-duplicate-imports": "error",
|
|
16
|
-
"no-empty-function": "error",
|
|
17
|
-
"no-lonely-if": "error",
|
|
18
|
-
"no-shadow": ["error", { allow: ["err", "resolve", "reject"] }],
|
|
19
|
-
"no-var": "error",
|
|
20
|
-
"prefer-const": "error",
|
|
21
|
-
"require-await": "warn",
|
|
22
|
-
"sort-imports": ["error", { ignoreDeclarationSort: true }],
|
|
23
|
-
"unicode-bom": ["error", "never"],
|
|
24
|
-
"yoda": "error",
|
|
25
|
-
},
|
|
26
|
-
};
|
package/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
"./base",
|
|
4
|
-
"./stylistic",
|
|
5
|
-
"./jsx",
|
|
6
|
-
],
|
|
7
|
-
plugins: [
|
|
8
|
-
"import",
|
|
9
|
-
"unused-imports",
|
|
10
|
-
],
|
|
11
|
-
rules: {
|
|
12
|
-
"import/order": [
|
|
13
|
-
"error",
|
|
14
|
-
{
|
|
15
|
-
alphabetize: {
|
|
16
|
-
caseInsensitive: false,
|
|
17
|
-
order: "asc",
|
|
18
|
-
},
|
|
19
|
-
groups: ["builtin", "external", "internal", "parent", "sibling", "index", "type", "object"],
|
|
20
|
-
pathGroups: [
|
|
21
|
-
{ group: "internal", pattern: "~/**" },
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
"unused-imports/no-unused-imports": "error",
|
|
26
|
-
"unused-imports/no-unused-vars": [
|
|
27
|
-
"warn",
|
|
28
|
-
{ args: "after-used", argsIgnorePattern: "^_", vars: "all", varsIgnorePattern: "^_" },
|
|
29
|
-
],
|
|
30
|
-
},
|
|
31
|
-
};
|
package/jsx.js
DELETED
package/stylistic.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
plugins: [
|
|
3
|
-
"@stylistic",
|
|
4
|
-
],
|
|
5
|
-
rules: {
|
|
6
|
-
"@stylistic/array-bracket-newline": ["error", "consistent"],
|
|
7
|
-
"@stylistic/array-bracket-spacing": ["error", "never"],
|
|
8
|
-
"@stylistic/array-element-newline": ["error", "consistent"],
|
|
9
|
-
"@stylistic/arrow-parens": ["error", "as-needed"],
|
|
10
|
-
"@stylistic/arrow-spacing": ["warn", { after: true, before: true }],
|
|
11
|
-
"@stylistic/block-spacing": ["error", "always"],
|
|
12
|
-
"@stylistic/brace-style": ["error", "1tbs"],
|
|
13
|
-
"@stylistic/comma-dangle": ["error", "always-multiline"],
|
|
14
|
-
"@stylistic/comma-spacing": ["error", { after: true, before: false }],
|
|
15
|
-
"@stylistic/comma-style": "error",
|
|
16
|
-
"@stylistic/computed-property-spacing": ["error", "never"],
|
|
17
|
-
"@stylistic/dot-location": ["error", "property"],
|
|
18
|
-
"@stylistic/eol-last": ["error", "always"],
|
|
19
|
-
"@stylistic/function-call-argument-newline": ["error", "consistent"],
|
|
20
|
-
"@stylistic/function-call-spacing": ["error", "never"],
|
|
21
|
-
"@stylistic/function-paren-newline": ["error", "multiline"],
|
|
22
|
-
"@stylistic/generator-star-spacing": ["error", "both"],
|
|
23
|
-
"@stylistic/implicit-arrow-linebreak": ["error", "beside"],
|
|
24
|
-
"@stylistic/indent": ["error", 2, { SwitchCase: 1 }],
|
|
25
|
-
"@stylistic/indent-binary-ops": "error",
|
|
26
|
-
"@stylistic/jsx-child-element-spacing": "error",
|
|
27
|
-
"@stylistic/jsx-closing-bracket-location": ["error", "tag-aligned"],
|
|
28
|
-
"@stylistic/jsx-closing-tag-location": "error",
|
|
29
|
-
"@stylistic/jsx-curly-brace-presence": ["error", {
|
|
30
|
-
children: "never",
|
|
31
|
-
propElementValues: "always",
|
|
32
|
-
props: "never",
|
|
33
|
-
}],
|
|
34
|
-
"@stylistic/jsx-curly-newline": ["error", {
|
|
35
|
-
multiline: "consistent",
|
|
36
|
-
singleline: "consistent",
|
|
37
|
-
}],
|
|
38
|
-
"@stylistic/jsx-curly-spacing": ["error", { when: "never" }],
|
|
39
|
-
"@stylistic/jsx-equals-spacing": ["error", "never"],
|
|
40
|
-
"@stylistic/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
|
|
41
|
-
"@stylistic/jsx-indent": ["error", 2],
|
|
42
|
-
"@stylistic/jsx-indent-props": ["error", 2],
|
|
43
|
-
"@stylistic/jsx-max-props-per-line": ["error", { maximum: { multi: 1, single: 4 } }],
|
|
44
|
-
"@stylistic/jsx-newline": ["error", { allowMultilines: false, prevent: true }],
|
|
45
|
-
"@stylistic/jsx-one-expression-per-line": ["error", { allow: "single-child" }],
|
|
46
|
-
"@stylistic/jsx-props-no-multi-spaces": "error",
|
|
47
|
-
"@stylistic/jsx-quotes": ["error", "prefer-double"],
|
|
48
|
-
"@stylistic/jsx-self-closing-comp": ["error", { component: true, html: true }],
|
|
49
|
-
"@stylistic/jsx-sort-props": "off",
|
|
50
|
-
"@stylistic/jsx-tag-spacing": "error",
|
|
51
|
-
"@stylistic/jsx-wrap-multilines": ["error", {
|
|
52
|
-
arrow: "parens-new-line",
|
|
53
|
-
assignment: "parens-new-line",
|
|
54
|
-
condition: "parens-new-line",
|
|
55
|
-
declaration: "parens-new-line",
|
|
56
|
-
logical: "parens-new-line",
|
|
57
|
-
prop: "parens-new-line",
|
|
58
|
-
return: "parens-new-line",
|
|
59
|
-
}],
|
|
60
|
-
"@stylistic/key-spacing": "error",
|
|
61
|
-
"@stylistic/keyword-spacing": "error",
|
|
62
|
-
"@stylistic/linebreak-style": ["error", "unix"],
|
|
63
|
-
"@stylistic/lines-around-comment": "off",
|
|
64
|
-
"@stylistic/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
|
|
65
|
-
"@stylistic/max-len": ["warn", { code: 128 }],
|
|
66
|
-
"@stylistic/max-statements-per-line": ["error", { max: 1 }],
|
|
67
|
-
"@stylistic/member-delimiter-style": ["error", {
|
|
68
|
-
multiline: { delimiter: "comma", requireLast: true },
|
|
69
|
-
multilineDetection: "brackets",
|
|
70
|
-
singleline: { delimiter: "comma", requireLast: false },
|
|
71
|
-
}],
|
|
72
|
-
"@stylistic/multiline-ternary": "off",
|
|
73
|
-
"@stylistic/new-parens": ["error", "always"],
|
|
74
|
-
"@stylistic/newline-per-chained-call": ["error", { ignoreChainWithDepth: 3 }],
|
|
75
|
-
"@stylistic/no-confusing-arrow": "error",
|
|
76
|
-
"@stylistic/no-extra-parens": "off",
|
|
77
|
-
"@stylistic/no-extra-semi": "error",
|
|
78
|
-
"@stylistic/no-floating-decimal": "error",
|
|
79
|
-
"@stylistic/no-mixed-operators": "error",
|
|
80
|
-
"@stylistic/no-mixed-spaces-and-tabs": "error",
|
|
81
|
-
"@stylistic/no-multi-spaces": "error",
|
|
82
|
-
"@stylistic/no-multiple-empty-lines": ["error", { max: 2, maxBOF: 0, maxEOF: 1 }],
|
|
83
|
-
"@stylistic/no-tabs": "error",
|
|
84
|
-
"@stylistic/no-trailing-spaces": "error",
|
|
85
|
-
"@stylistic/no-whitespace-before-property": "error",
|
|
86
|
-
"@stylistic/nonblock-statement-body-position": ["error", "beside"],
|
|
87
|
-
"@stylistic/object-curly-newline": "error",
|
|
88
|
-
"@stylistic/object-curly-spacing": ["error", "always"],
|
|
89
|
-
"@stylistic/object-property-newline": "off",
|
|
90
|
-
"@stylistic/one-var-declaration-per-line": ["error", "initializations"],
|
|
91
|
-
"@stylistic/operator-linebreak": "error",
|
|
92
|
-
"@stylistic/padded-blocks": ["error", "never"],
|
|
93
|
-
"@stylistic/padding-line-between-statements": "error",
|
|
94
|
-
"@stylistic/quote-props": ["error", "consistent-as-needed"],
|
|
95
|
-
"@stylistic/quotes": ["error", "double", { avoidEscape: true }],
|
|
96
|
-
"@stylistic/rest-spread-spacing": ["error", "never"],
|
|
97
|
-
"@stylistic/semi": ["error", "always"],
|
|
98
|
-
"@stylistic/semi-spacing": ["error", { after: true, before: false }],
|
|
99
|
-
"@stylistic/semi-style": "error",
|
|
100
|
-
"@stylistic/space-before-blocks": "error",
|
|
101
|
-
"@stylistic/space-before-function-paren": ["error", {
|
|
102
|
-
anonymous: "never",
|
|
103
|
-
asyncArrow: "always",
|
|
104
|
-
named: "never",
|
|
105
|
-
}],
|
|
106
|
-
"@stylistic/space-in-parens": "error",
|
|
107
|
-
"@stylistic/space-infix-ops": "error",
|
|
108
|
-
"@stylistic/space-unary-ops": "error",
|
|
109
|
-
"@stylistic/spaced-comment": "error",
|
|
110
|
-
"@stylistic/switch-colon-spacing": ["error", { after: true, before: false }],
|
|
111
|
-
"@stylistic/template-curly-spacing": ["error", "never"],
|
|
112
|
-
"@stylistic/template-tag-spacing": ["error", "never"],
|
|
113
|
-
"@stylistic/type-annotation-spacing": "error",
|
|
114
|
-
"@stylistic/type-generic-spacing": "error",
|
|
115
|
-
"@stylistic/type-named-tuple-spacing": "error",
|
|
116
|
-
"@stylistic/wrap-iife": ["error", "outside"],
|
|
117
|
-
"@stylistic/wrap-regex": "error",
|
|
118
|
-
"@stylistic/yield-star-spacing": ["error", "both"],
|
|
119
|
-
},
|
|
120
|
-
};
|
package/typescript.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
"plugin:@typescript-eslint/recommended",
|
|
4
|
-
],
|
|
5
|
-
plugins: [
|
|
6
|
-
"@typescript-eslint",
|
|
7
|
-
],
|
|
8
|
-
rules: {
|
|
9
|
-
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
10
|
-
"@typescript-eslint/array-type": "error",
|
|
11
|
-
"@typescript-eslint/ban-ts-comment": "warn",
|
|
12
|
-
"@typescript-eslint/ban-tslint-comment": "warn",
|
|
13
|
-
"@typescript-eslint/class-methods-use-this": "error",
|
|
14
|
-
"@typescript-eslint/consistent-indexed-object-style": "error",
|
|
15
|
-
"@typescript-eslint/consistent-type-exports": "error",
|
|
16
|
-
"@typescript-eslint/consistent-type-imports": "error",
|
|
17
|
-
"@typescript-eslint/dot-notation": "error",
|
|
18
|
-
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
|
19
|
-
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
20
|
-
"@typescript-eslint/no-unused-vars": "off",
|
|
21
|
-
"@typescript-eslint/prefer-includes": "error",
|
|
22
|
-
"@typescript-eslint/prefer-nullish-coalescing": ["error", {
|
|
23
|
-
ignorePrimitives: {
|
|
24
|
-
string: true,
|
|
25
|
-
},
|
|
26
|
-
}],
|
|
27
|
-
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
28
|
-
"class-methods-use-this": "off",
|
|
29
|
-
"dot-notation": "off",
|
|
30
|
-
},
|
|
31
|
-
};
|