@kembec/eslint-config 1.1.3 → 2.0.0
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 +74 -0
- package/commit.log +2 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/eslint-config-kembec/eslint.config.js.html +94 -0
- package/coverage/lcov-report/eslint-config-kembec/index.html +116 -0
- package/coverage/lcov-report/eslint-config-kembec/index.js.html +145 -0
- package/coverage/lcov-report/eslint-config-kembec/presets/index.html +161 -0
- package/coverage/lcov-report/eslint-config-kembec/presets/js.js.html +208 -0
- package/coverage/lcov-report/eslint-config-kembec/presets/react.js.html +244 -0
- package/coverage/lcov-report/eslint-config-kembec/presets/ts.js.html +214 -0
- package/coverage/lcov-report/eslint-config-kembec/presets/vitest.js.html +124 -0
- package/coverage/lcov-report/eslint-config-kembec/rules/best-practices.js.html +160 -0
- package/coverage/lcov-report/eslint-config-kembec/rules/errors.js.html +163 -0
- package/coverage/lcov-report/eslint-config-kembec/rules/index.html +176 -0
- package/coverage/lcov-report/eslint-config-kembec/rules/plugins.js.html +256 -0
- package/coverage/lcov-report/eslint-config-kembec/rules/style.js.html +106 -0
- package/coverage/lcov-report/eslint-config-kembec/rules/typescript.js.html +280 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +146 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +125 -0
- package/index.js +20 -16
- package/package.json +42 -23
- package/presets/js.js +41 -0
- package/presets/react.js +53 -0
- package/presets/ts.js +43 -0
- package/presets/vitest.js +13 -0
- package/rules/best-practices.js +3 -2
- package/rules/errors.js +3 -1
- package/rules/plugins.js +56 -46
- package/rules/style.js +2 -5
- package/rules/typescript.js +17 -20
- package/.eslintrc +0 -3
- package/Readme.md +0 -94
- package/jest/index.js +0 -11
- package/rules/variables.js +0 -7
- package/typescript/index.js +0 -28
- package/typescript/jest/index.js +0 -11
package/presets/js.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import prettierConfig from "eslint-config-prettier";
|
|
3
|
+
import importXPlugin from "eslint-plugin-import-x";
|
|
4
|
+
import globals from "globals";
|
|
5
|
+
|
|
6
|
+
import bestPractices from "../rules/best-practices.js";
|
|
7
|
+
import errors from "../rules/errors.js";
|
|
8
|
+
import { importXRules, pluginInstances, pluginRules } from "../rules/plugins.js";
|
|
9
|
+
import style from "../rules/style.js";
|
|
10
|
+
|
|
11
|
+
export function buildJsPreset() {
|
|
12
|
+
return [
|
|
13
|
+
js.configs.recommended,
|
|
14
|
+
prettierConfig,
|
|
15
|
+
{
|
|
16
|
+
files: ["**/*.{js,jsx,mjs,cjs}"],
|
|
17
|
+
languageOptions: {
|
|
18
|
+
ecmaVersion: "latest",
|
|
19
|
+
sourceType: "module",
|
|
20
|
+
globals: {
|
|
21
|
+
...globals.browser,
|
|
22
|
+
...globals.es2022,
|
|
23
|
+
...globals.node,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
plugins: {
|
|
27
|
+
...pluginInstances,
|
|
28
|
+
"import-x": importXPlugin,
|
|
29
|
+
},
|
|
30
|
+
rules: {
|
|
31
|
+
...bestPractices.rules,
|
|
32
|
+
...errors.rules,
|
|
33
|
+
...style.rules,
|
|
34
|
+
...pluginRules,
|
|
35
|
+
...importXRules,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default buildJsPreset();
|
package/presets/react.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import prettierConfig from "eslint-config-prettier";
|
|
2
|
+
import importXPlugin from "eslint-plugin-import-x";
|
|
3
|
+
import reactPlugin from "eslint-plugin-react";
|
|
4
|
+
import reactHooksPlugin from "eslint-plugin-react-hooks";
|
|
5
|
+
import globals from "globals";
|
|
6
|
+
import tseslint from "typescript-eslint";
|
|
7
|
+
|
|
8
|
+
import bestPractices from "../rules/best-practices.js";
|
|
9
|
+
import errors from "../rules/errors.js";
|
|
10
|
+
import { importXRules, pluginInstances, pluginRules } from "../rules/plugins.js";
|
|
11
|
+
import style from "../rules/style.js";
|
|
12
|
+
import typescriptRules from "../rules/typescript.js";
|
|
13
|
+
|
|
14
|
+
export function buildReactPreset(tsconfigPath = "./tsconfig.json") {
|
|
15
|
+
return tseslint.config(prettierConfig, ...tseslint.configs.recommendedTypeChecked, {
|
|
16
|
+
files: ["**/*.{ts,tsx}"],
|
|
17
|
+
languageOptions: {
|
|
18
|
+
ecmaVersion: "latest",
|
|
19
|
+
sourceType: "module",
|
|
20
|
+
globals: {
|
|
21
|
+
...globals.browser,
|
|
22
|
+
...globals.es2022,
|
|
23
|
+
},
|
|
24
|
+
parserOptions: {
|
|
25
|
+
project: tsconfigPath,
|
|
26
|
+
ecmaFeatures: { jsx: true },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
plugins: {
|
|
30
|
+
...pluginInstances,
|
|
31
|
+
"import-x": importXPlugin,
|
|
32
|
+
react: reactPlugin,
|
|
33
|
+
"react-hooks": reactHooksPlugin,
|
|
34
|
+
},
|
|
35
|
+
settings: {
|
|
36
|
+
react: { version: "detect" },
|
|
37
|
+
},
|
|
38
|
+
rules: {
|
|
39
|
+
...bestPractices.rules,
|
|
40
|
+
...errors.rules,
|
|
41
|
+
...style.rules,
|
|
42
|
+
...pluginRules,
|
|
43
|
+
...typescriptRules.rules,
|
|
44
|
+
...reactPlugin.configs.recommended.rules,
|
|
45
|
+
...reactHooksPlugin.configs.recommended.rules,
|
|
46
|
+
"react/react-in-jsx-scope": "off",
|
|
47
|
+
"react/prop-types": "off",
|
|
48
|
+
...importXRules,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default buildReactPreset();
|
package/presets/ts.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import prettierConfig from "eslint-config-prettier";
|
|
2
|
+
import importXPlugin from "eslint-plugin-import-x";
|
|
3
|
+
import globals from "globals";
|
|
4
|
+
import tseslint from "typescript-eslint";
|
|
5
|
+
|
|
6
|
+
import bestPractices from "../rules/best-practices.js";
|
|
7
|
+
import errors from "../rules/errors.js";
|
|
8
|
+
import { importXRules, pluginInstances, pluginRules } from "../rules/plugins.js";
|
|
9
|
+
import style from "../rules/style.js";
|
|
10
|
+
import typescriptRules from "../rules/typescript.js";
|
|
11
|
+
|
|
12
|
+
export function buildTsPreset(tsconfigPath = "./tsconfig.json") {
|
|
13
|
+
return tseslint.config(prettierConfig, ...tseslint.configs.recommendedTypeChecked, {
|
|
14
|
+
files: ["**/*.{ts,tsx}"],
|
|
15
|
+
languageOptions: {
|
|
16
|
+
ecmaVersion: "latest",
|
|
17
|
+
sourceType: "module",
|
|
18
|
+
globals: {
|
|
19
|
+
...globals.browser,
|
|
20
|
+
...globals.es2022,
|
|
21
|
+
...globals.node,
|
|
22
|
+
},
|
|
23
|
+
parserOptions: {
|
|
24
|
+
project: tsconfigPath,
|
|
25
|
+
ecmaFeatures: { jsx: true },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
plugins: {
|
|
29
|
+
...pluginInstances,
|
|
30
|
+
"import-x": importXPlugin,
|
|
31
|
+
},
|
|
32
|
+
rules: {
|
|
33
|
+
...bestPractices.rules,
|
|
34
|
+
...errors.rules,
|
|
35
|
+
...style.rules,
|
|
36
|
+
...pluginRules,
|
|
37
|
+
...typescriptRules.rules,
|
|
38
|
+
...importXRules,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default buildTsPreset();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import vitestPlugin from "@vitest/eslint-plugin";
|
|
2
|
+
|
|
3
|
+
export default [
|
|
4
|
+
{
|
|
5
|
+
files: ["**/*.test.{js,ts,jsx,tsx}", "**/*.spec.{js,ts,jsx,tsx}", "**/__tests__/**/*.{js,ts,jsx,tsx}"],
|
|
6
|
+
plugins: {
|
|
7
|
+
vitest: vitestPlugin,
|
|
8
|
+
},
|
|
9
|
+
rules: {
|
|
10
|
+
...vitestPlugin.configs.recommended.rules,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
];
|
package/rules/best-practices.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
export default {
|
|
2
2
|
rules: {
|
|
3
3
|
camelcase: ["error", { properties: "never" }],
|
|
4
|
-
eqeqeq: "error",
|
|
4
|
+
eqeqeq: ["error", "always", { null: "ignore" }],
|
|
5
5
|
"new-cap": ["error", { capIsNew: false }],
|
|
6
6
|
"no-array-constructor": "error",
|
|
7
|
+
"no-var": "error",
|
|
7
8
|
"no-console": ["error", { allow: ["error"] }],
|
|
8
9
|
"no-else-return": ["error", { allowElseIf: false }],
|
|
9
10
|
"no-extend-native": "error",
|
package/rules/errors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export default {
|
|
2
2
|
rules: {
|
|
3
3
|
"array-callback-return": ["error", { checkForEach: true }],
|
|
4
4
|
"no-await-in-loop": "error",
|
|
@@ -6,9 +6,11 @@ module.exports = {
|
|
|
6
6
|
"no-constructor-return": "error",
|
|
7
7
|
"no-promise-executor-return": "error",
|
|
8
8
|
"no-self-compare": "error",
|
|
9
|
+
"no-shadow-restricted-names": ["error", { reportGlobalThis: true }],
|
|
9
10
|
"no-template-curly-in-string": "error",
|
|
10
11
|
"no-unmodified-loop-condition": "error",
|
|
11
12
|
"no-unreachable-loop": "error",
|
|
13
|
+
"no-unused-expressions": ["error", { ignoreDirectives: true }],
|
|
12
14
|
"no-unused-private-class-members": "error",
|
|
13
15
|
"no-use-before-define": [
|
|
14
16
|
"error",
|
package/rules/plugins.js
CHANGED
|
@@ -1,47 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
import prettierPlugin from "eslint-plugin-prettier";
|
|
2
|
+
import simpleImportSortPlugin from "eslint-plugin-simple-import-sort";
|
|
3
|
+
import unusedImportsPlugin from "eslint-plugin-unused-imports";
|
|
4
|
+
|
|
5
|
+
export const pluginInstances = {
|
|
6
|
+
prettier: prettierPlugin,
|
|
7
|
+
"simple-import-sort": simpleImportSortPlugin,
|
|
8
|
+
"unused-imports": unusedImportsPlugin,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const pluginRules = {
|
|
12
|
+
"prettier/prettier": [
|
|
13
|
+
"error",
|
|
14
|
+
{
|
|
15
|
+
arrowParens: "always",
|
|
16
|
+
bracketSameLine: false,
|
|
17
|
+
bracketSpacing: true,
|
|
18
|
+
semi: true,
|
|
19
|
+
experimentalTernaries: false,
|
|
20
|
+
singleQuote: false,
|
|
21
|
+
jsxSingleQuote: false,
|
|
22
|
+
quoteProps: "as-needed",
|
|
23
|
+
trailingComma: "es5",
|
|
24
|
+
singleAttributePerLine: true,
|
|
25
|
+
htmlWhitespaceSensitivity: "css",
|
|
26
|
+
vueIndentScriptAndStyle: true,
|
|
27
|
+
proseWrap: "preserve",
|
|
28
|
+
insertPragma: false,
|
|
29
|
+
printWidth: 120,
|
|
30
|
+
requirePragma: false,
|
|
31
|
+
tabWidth: 4,
|
|
32
|
+
useTabs: true,
|
|
33
|
+
embeddedLanguageFormatting: "auto",
|
|
34
|
+
endOfLine: "lf",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
"simple-import-sort/exports": "error",
|
|
38
|
+
"simple-import-sort/imports": "error",
|
|
39
|
+
"unused-imports/no-unused-imports": "error",
|
|
40
|
+
"no-unused-vars": "off",
|
|
41
|
+
"unused-imports/no-unused-vars": [
|
|
42
|
+
"warn",
|
|
43
|
+
{
|
|
44
|
+
vars: "all",
|
|
45
|
+
varsIgnorePattern: "^_",
|
|
46
|
+
args: "after-used",
|
|
47
|
+
argsIgnorePattern: "^_",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const importXRules = {
|
|
53
|
+
"import-x/first": "error",
|
|
54
|
+
"import-x/newline-after-import": "error",
|
|
55
|
+
"import-x/no-duplicates": "error",
|
|
56
|
+
"import-x/no-webpack-loader-syntax": "error",
|
|
47
57
|
};
|
package/rules/style.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export default {
|
|
2
2
|
rules: {
|
|
3
3
|
curly: "error",
|
|
4
4
|
"lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
|
|
5
|
-
"padding-line-between-statements": [
|
|
6
|
-
"error",
|
|
7
|
-
{ blankLine: "always", prev: "*", next: "return" },
|
|
8
|
-
],
|
|
5
|
+
"padding-line-between-statements": ["error", { blankLine: "always", prev: "*", next: "return" }],
|
|
9
6
|
},
|
|
10
7
|
};
|
package/rules/typescript.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
plugins: ["@typescript-eslint"],
|
|
1
|
+
export default {
|
|
3
2
|
rules: {
|
|
4
3
|
"@typescript-eslint/member-ordering": [
|
|
5
4
|
"error",
|
|
6
5
|
{
|
|
7
6
|
default: [
|
|
8
7
|
"signature",
|
|
9
|
-
|
|
10
8
|
"private-decorated-field",
|
|
11
9
|
"private-instance-field",
|
|
12
10
|
"private-static-field",
|
|
@@ -18,11 +16,9 @@ module.exports = {
|
|
|
18
16
|
"public-decorated-field",
|
|
19
17
|
"public-instance-field",
|
|
20
18
|
"public-static-field",
|
|
21
|
-
|
|
22
19
|
"private-constructor",
|
|
23
20
|
"protected-constructor",
|
|
24
21
|
"public-constructor",
|
|
25
|
-
|
|
26
22
|
"private-decorated-method",
|
|
27
23
|
"private-instance-method",
|
|
28
24
|
"private-static-method",
|
|
@@ -37,24 +33,24 @@ module.exports = {
|
|
|
37
33
|
],
|
|
38
34
|
},
|
|
39
35
|
],
|
|
40
|
-
"@typescript-eslint/no-confusing-non-null-assertion":
|
|
36
|
+
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
41
37
|
"@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],
|
|
42
|
-
"@typescript-eslint/no-explicit-any":
|
|
43
|
-
"@typescript-eslint/no-extra-non-null-assertion":
|
|
44
|
-
"@typescript-eslint/no-floating-promises":
|
|
45
|
-
"@typescript-eslint/no-non-null-asserted-optional-chain":
|
|
46
|
-
"@typescript-eslint/no-non-null-assertion":
|
|
47
|
-
"@typescript-eslint/no-require-imports":
|
|
48
|
-
"@typescript-eslint/no-unnecessary-boolean-literal-compare":
|
|
49
|
-
"@typescript-eslint/no-unnecessary-condition":
|
|
38
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
39
|
+
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
40
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
41
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
42
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
43
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
44
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
|
45
|
+
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
50
46
|
"@typescript-eslint/no-unused-vars": "off",
|
|
51
|
-
"@typescript-eslint/no-useless-constructor":
|
|
52
|
-
"@typescript-eslint/prefer-for-of":
|
|
53
|
-
"@typescript-eslint/prefer-nullish-coalescing":
|
|
54
|
-
"@typescript-eslint/prefer-readonly":
|
|
47
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
48
|
+
"@typescript-eslint/prefer-for-of": "error",
|
|
49
|
+
"@typescript-eslint/prefer-nullish-coalescing": "error",
|
|
50
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
55
51
|
"@typescript-eslint/promise-function-async": ["error", { checkArrowFunctions: false }],
|
|
56
|
-
"@typescript-eslint/require-await":
|
|
57
|
-
"@typescript-eslint/switch-exhaustiveness-check":
|
|
52
|
+
"@typescript-eslint/require-await": "warn",
|
|
53
|
+
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
58
54
|
"@typescript-eslint/explicit-member-accessibility": [
|
|
59
55
|
"error",
|
|
60
56
|
{
|
|
@@ -64,5 +60,6 @@ module.exports = {
|
|
|
64
60
|
},
|
|
65
61
|
},
|
|
66
62
|
],
|
|
63
|
+
"@typescript-eslint/explicit-module-boundary-types": "error",
|
|
67
64
|
},
|
|
68
65
|
};
|
package/.eslintrc
DELETED
package/Readme.md
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# Streamlined ESLint Configuration for JS/TS Projects
|
|
2
|
-
|
|
3
|
-
This document outlines how to integrate my ESLint setup into your JavaScript or TypeScript projects. It's a personal collection of configurations and plugins designed to enforce a consistent coding style and catch common errors.
|
|
4
|
-
|
|
5
|
-
## Quick Start Guide
|
|
6
|
-
|
|
7
|
-
### Step 1: Installation
|
|
8
|
-
|
|
9
|
-
Add the configuration package to your development dependencies:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install -D @kembec/eslint-config
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### Step 2: Configure ESLint
|
|
16
|
-
|
|
17
|
-
Modify your ESLint configuration file to use this package. The setup varies slightly depending on whether you're working with plain JavaScript or TypeScript.
|
|
18
|
-
|
|
19
|
-
- **For JavaScript Projects**: In your `.eslintrc` file (which could be `.json`, `.js`, or `.ts`), include the following setup. To use Jest, change the extends value as shown in the comment:
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"extends": ["@kembec/eslint-config"] // To use Jest, change to "@kembec/eslint-config/jest"
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
- **For TypeScript Projects**: To include TypeScript-specific rules and configure parser options, use the following setup. To use Jest, modify the extends value as shown in the comment:
|
|
28
|
-
|
|
29
|
-
```json
|
|
30
|
-
{
|
|
31
|
-
"extends": ["@kembec/eslint-config/typescript"], // To use Jest, change to "@kembec/eslint-config/typescript/jest"
|
|
32
|
-
"overrides": [
|
|
33
|
-
{
|
|
34
|
-
"files": ["*.ts", "*.tsx"],
|
|
35
|
-
"parserOptions": {
|
|
36
|
-
"project": ["./tsconfig.json"]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
- **For React Projects**:
|
|
44
|
-
|
|
45
|
-
```json
|
|
46
|
-
{
|
|
47
|
-
"extends": [
|
|
48
|
-
"@kembec/eslint-config/typescript",
|
|
49
|
-
"plugin:@typescript-eslint/recommended",
|
|
50
|
-
"plugin:react-hooks/recommended"
|
|
51
|
-
],
|
|
52
|
-
"ignorePatterns": ["dist", ".eslintrc.cjs", "vite.config.ts"],
|
|
53
|
-
"overrides": [
|
|
54
|
-
{
|
|
55
|
-
"files": ["src/**/*.ts", "src/**/*.tsx"],
|
|
56
|
-
"parserOptions": {
|
|
57
|
-
"project": ["./tsconfig.json"]
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Included Plugins
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
The configuration incorporates a carefully selected set of ESLint plugins to assist with various code quality and style concerns:
|
|
68
|
-
|
|
69
|
-
- `eslint-plugin-import`: Manages and validates import statements.
|
|
70
|
-
- `eslint-plugin-jest`: Provides linting rules for Jest tests.
|
|
71
|
-
- `eslint-plugin-prettier`: Integrates Prettier formatting into ESLint.
|
|
72
|
-
- `eslint-plugin-simple-import-sort`: Automatically sorts import statements.
|
|
73
|
-
- `eslint-plugin-unused-imports`: Helps in removing unused imports.
|
|
74
|
-
- `@typescript-eslint/eslint-plugin`: Adds TypeScript-specific linting rules.
|
|
75
|
-
- `@typescript-eslint/parser`: Allows ESLint to parse TypeScript code.
|
|
76
|
-
|
|
77
|
-
These plugins are intended to help maintain a clean codebase and promote coding best practices.
|
|
78
|
-
|
|
79
|
-
## Usage
|
|
80
|
-
|
|
81
|
-
Integrate linting into your workflow with these npm scripts:
|
|
82
|
-
|
|
83
|
-
```json
|
|
84
|
-
"scripts": {
|
|
85
|
-
"lint": "eslint .",
|
|
86
|
-
"lint:fix": "eslint --fix ."
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Use `npm run lint` to identify issues or `npm run lint:fix` to fix many issues automatically.
|
|
91
|
-
|
|
92
|
-
## License
|
|
93
|
-
|
|
94
|
-
This project is licensed under the [AGPL-3.0](https://opensource.org/licenses/AGPL-3.0). Its use, modification, and distribution are allowed under the terms of this license.
|
package/jest/index.js
DELETED
package/rules/variables.js
DELETED
package/typescript/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: "@typescript-eslint/parser",
|
|
3
|
-
parserOptions: {
|
|
4
|
-
ecmaFeatures: {
|
|
5
|
-
jsx: true,
|
|
6
|
-
},
|
|
7
|
-
ecmaVersion: 12,
|
|
8
|
-
sourceType: "module",
|
|
9
|
-
},
|
|
10
|
-
extends: ["../index.js"],
|
|
11
|
-
overrides: [
|
|
12
|
-
{
|
|
13
|
-
files: ["*.ts", "*.tsx"],
|
|
14
|
-
extends: [
|
|
15
|
-
"plugin:@typescript-eslint/recommended",
|
|
16
|
-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
17
|
-
"plugin:import/typescript",
|
|
18
|
-
...["../rules/typescript"].map(require.resolve),
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
files: ["*.ts"],
|
|
23
|
-
rules: {
|
|
24
|
-
"@typescript-eslint/explicit-module-boundary-types": ["error"],
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
};
|