@mysetup/eslint-config 2.0.1-1 โ 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/index.js +87 -99
- package/package.json +6 -12
package/index.js
CHANGED
|
@@ -1,109 +1,97 @@
|
|
|
1
|
-
// eslint.config.js
|
|
2
|
-
import js from "@eslint/js";
|
|
3
|
-
import tseslint from "typescript-eslint";
|
|
4
|
-
import reactPlugin from "eslint-plugin-react";
|
|
5
|
-
import reactHooks from "eslint-plugin-react-hooks";
|
|
6
|
-
import prettierPlugin from "eslint-plugin-prettier";
|
|
7
|
-
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
8
|
-
import nextPlugin from "@next/eslint-plugin-next";
|
|
9
|
-
import jestPlugin from "eslint-plugin-jest";
|
|
10
|
-
|
|
11
1
|
const project = ["**/tsconfig.json"];
|
|
12
2
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
3
|
+
module.exports = {
|
|
4
|
+
extends: [
|
|
5
|
+
"eslint:recommended",
|
|
6
|
+
"prettier",
|
|
7
|
+
"plugin:@next/next/core-web-vitals",
|
|
8
|
+
require.resolve("@vercel/style-guide/eslint/browser"),
|
|
9
|
+
require.resolve("@vercel/style-guide/eslint/node"),
|
|
10
|
+
require.resolve("@vercel/style-guide/eslint/react"),
|
|
11
|
+
],
|
|
12
|
+
plugins: ["prettier"],
|
|
13
|
+
rules: {
|
|
14
|
+
camelcase: "off",
|
|
15
|
+
"eslint-comments/require-description": "off",
|
|
16
|
+
"import/no-default-export": "off",
|
|
17
|
+
"jsx-a11y/anchor-is-valid": "off",
|
|
18
|
+
"@next/next/no-html-link-for-pages": "off",
|
|
19
|
+
"prettier/prettier": "error",
|
|
20
|
+
"react/button-has-type": "off",
|
|
21
|
+
"react/function-component-definition": [
|
|
22
|
+
"error",
|
|
23
|
+
{
|
|
24
|
+
namedComponents: ["arrow-function", "function-declaration"],
|
|
25
|
+
unnamedComponents: "arrow-function",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
"react/jsx-key": "off",
|
|
29
|
+
"react/no-unescaped-entities": "off",
|
|
30
|
+
"unicorn/filename-case": "off",
|
|
31
|
+
},
|
|
32
|
+
ignorePatterns: ["build/", "coverage/", "dist/", "generated/", ".next/"],
|
|
33
|
+
overrides: [
|
|
34
|
+
{
|
|
35
|
+
files: ["*.ts", "*.tsx"],
|
|
36
|
+
extends: [require.resolve("@vercel/style-guide/eslint/typescript")],
|
|
37
|
+
parserOptions: {
|
|
38
|
+
project,
|
|
39
|
+
},
|
|
40
|
+
rules: {
|
|
41
|
+
"tsdoc/syntax": "off",
|
|
42
|
+
"@typescript-eslint/consistent-type-assertions": "off",
|
|
43
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
44
|
+
"@typescript-eslint/no-confusing-void-expression": "warn",
|
|
45
|
+
"@typescript-eslint/no-misused-promises": [
|
|
46
|
+
"error",
|
|
47
|
+
{
|
|
48
|
+
checksVoidReturn: false,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
"@typescript-eslint/no-unnecessary-condition": "warn",
|
|
52
|
+
"@typescript-eslint/require-await": "off",
|
|
53
|
+
"@typescript-eslint/prefer-nullish-coalescing": "off",
|
|
54
|
+
"@typescript-eslint/restrict-template-expressions": "off",
|
|
55
|
+
},
|
|
26
56
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"import/no-default-export": "off",
|
|
34
|
-
"jsx-a11y/anchor-is-valid": "off",
|
|
35
|
-
"@next/next/no-html-link-for-pages": "off",
|
|
36
|
-
"prettier/prettier": "error",
|
|
37
|
-
"react/button-has-type": "off",
|
|
38
|
-
"react/function-component-definition": [
|
|
39
|
-
"error",
|
|
40
|
-
{
|
|
41
|
-
namedComponents: ["arrow-function", "function-declaration"],
|
|
42
|
-
unnamedComponents: "arrow-function",
|
|
43
|
-
},
|
|
57
|
+
{
|
|
58
|
+
files: [
|
|
59
|
+
"**/__fixtures__/*.ts",
|
|
60
|
+
"**/__mocks__/*.ts",
|
|
61
|
+
"*.test.ts",
|
|
62
|
+
"*.test.tsx",
|
|
44
63
|
],
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"packages/*/tsconfig.json",
|
|
57
|
-
],
|
|
58
|
-
},
|
|
64
|
+
extends: [require.resolve("@vercel/style-guide/eslint/jest")],
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project,
|
|
67
|
+
},
|
|
68
|
+
rules: {
|
|
69
|
+
"jest/prefer-lowercase-title": "off",
|
|
70
|
+
"jest/no-mocks-import": "off",
|
|
71
|
+
"sonarjs/no-duplicate-string": "off",
|
|
72
|
+
"testing-library/no-container": "off",
|
|
73
|
+
"testing-library/render-result-naming-convention": "off",
|
|
74
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
59
75
|
},
|
|
60
76
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"@typescript-eslint/consistent-type-assertions": "off",
|
|
70
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
71
|
-
"@typescript-eslint/no-confusing-void-expression": "warn",
|
|
72
|
-
"@typescript-eslint/no-misused-promises": [
|
|
73
|
-
"error",
|
|
74
|
-
{ checksVoidReturn: false },
|
|
75
|
-
],
|
|
76
|
-
"@typescript-eslint/no-unnecessary-condition": "warn",
|
|
77
|
-
"@typescript-eslint/require-await": "off",
|
|
78
|
-
"@typescript-eslint/prefer-nullish-coalescing": "off",
|
|
79
|
-
"@typescript-eslint/restrict-template-expressions": "off",
|
|
77
|
+
{
|
|
78
|
+
files: ["*.stories.tsx"],
|
|
79
|
+
parserOptions: {
|
|
80
|
+
project,
|
|
81
|
+
},
|
|
82
|
+
rules: {
|
|
83
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
84
|
+
},
|
|
80
85
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
files: [
|
|
86
|
-
"**/__fixtures__/*.ts",
|
|
87
|
-
"**/__mocks__/*.ts",
|
|
88
|
-
"**/*.test.ts",
|
|
89
|
-
"**/*.test.tsx",
|
|
90
|
-
],
|
|
91
|
-
rules: {
|
|
92
|
-
...jestPlugin.configs.recommended.rules,
|
|
93
|
-
"jest/prefer-lowercase-title": "off",
|
|
94
|
-
"jest/no-mocks-import": "off",
|
|
95
|
-
"sonarjs/no-duplicate-string": "off",
|
|
96
|
-
"testing-library/no-container": "off",
|
|
97
|
-
"testing-library/render-result-naming-convention": "off",
|
|
98
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
86
|
+
],
|
|
87
|
+
settings: {
|
|
88
|
+
react: {
|
|
89
|
+
version: "18.3.1",
|
|
99
90
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
files: ["**/*.stories.tsx"],
|
|
105
|
-
rules: {
|
|
106
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
91
|
+
"import/resolver": {
|
|
92
|
+
typescript: {
|
|
93
|
+
project: ["apps/*/tsconfig.json", "packages/*/tsconfig.json"],
|
|
94
|
+
},
|
|
107
95
|
},
|
|
108
96
|
},
|
|
109
|
-
|
|
97
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mysetup/eslint-config",
|
|
3
|
-
"version": "2.0.1
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,23 +8,17 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@mysetup/prettier-config": "latest",
|
|
11
|
+
"@next/eslint-plugin-next": "^16.0.1",
|
|
11
12
|
"@vercel/style-guide": "^6.0.0",
|
|
12
|
-
"eslint
|
|
13
|
+
"eslint": "9.38.0",
|
|
14
|
+
"eslint-config-prettier": "^10.1.8",
|
|
15
|
+
"eslint-plugin-prettier": "^5.5.4"
|
|
13
16
|
},
|
|
14
17
|
"devDependencies": {
|
|
15
18
|
"@babel/core": "^7.28.5",
|
|
16
19
|
"@babel/eslint-parser": "^7.28.5",
|
|
17
|
-
"@eslint/js": "^9.38.0",
|
|
18
|
-
"@next/eslint-plugin-next": "^16.0.1",
|
|
19
|
-
"eslint": "9.38.0",
|
|
20
|
-
"eslint-plugin-jest": "^29.0.1",
|
|
21
|
-
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
22
|
-
"eslint-plugin-prettier": "^5.5.4",
|
|
23
|
-
"eslint-plugin-react": "^7.37.5",
|
|
24
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
25
20
|
"prettier": "^3.6.2",
|
|
26
|
-
"typescript": "5.5.4"
|
|
27
|
-
"typescript-eslint": "^8.46.2"
|
|
21
|
+
"typescript": "5.5.4"
|
|
28
22
|
},
|
|
29
23
|
"prettier": "@mysetup/prettier-config",
|
|
30
24
|
"engines": {
|