@mysetup/eslint-config 2.0.0 โ 2.0.1-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 +99 -87
- package/package.json +15 -11
package/index.js
CHANGED
|
@@ -1,97 +1,109 @@
|
|
|
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
|
+
|
|
1
11
|
const project = ["**/tsconfig.json"];
|
|
2
12
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
},
|
|
13
|
+
export default [
|
|
14
|
+
js.configs.recommended,
|
|
15
|
+
...tseslint.configs.recommended,
|
|
16
|
+
reactPlugin.configs.recommended,
|
|
17
|
+
jsxA11y.flatConfigs.recommended,
|
|
18
|
+
|
|
19
|
+
{
|
|
20
|
+
plugins: {
|
|
21
|
+
react: reactPlugin,
|
|
22
|
+
"react-hooks": reactHooks,
|
|
23
|
+
prettier: prettierPlugin,
|
|
24
|
+
"@next/next": nextPlugin,
|
|
25
|
+
jest: jestPlugin,
|
|
56
26
|
},
|
|
57
|
-
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
27
|
+
rules: {
|
|
28
|
+
camelcase: "off",
|
|
29
|
+
...nextPlugin.configs["core-web-vitals"].rules,
|
|
30
|
+
|
|
31
|
+
// ๐ง Custom overrides
|
|
32
|
+
"eslint-comments/require-description": "off",
|
|
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
|
+
},
|
|
63
44
|
],
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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",
|
|
75
|
-
},
|
|
45
|
+
"react/jsx-key": "off",
|
|
46
|
+
"react/no-unescaped-entities": "off",
|
|
47
|
+
"unicorn/filename-case": "off",
|
|
76
48
|
},
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
49
|
+
settings: {
|
|
50
|
+
react: { version: "detect" },
|
|
51
|
+
next: { rootDir: ["apps/*/"] },
|
|
52
|
+
"import/resolver": {
|
|
53
|
+
typescript: {
|
|
54
|
+
project: [
|
|
55
|
+
"apps/*/tsconfig.json",
|
|
56
|
+
"packages/*/tsconfig.json",
|
|
57
|
+
],
|
|
58
|
+
},
|
|
84
59
|
},
|
|
85
60
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
61
|
+
ignores: ["build", "coverage", "dist", "generated", ".next"],
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
// ๐งฉ TypeScript overrides
|
|
65
|
+
{
|
|
66
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
67
|
+
rules: {
|
|
68
|
+
"tsdoc/syntax": "off",
|
|
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",
|
|
90
80
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
// ๐งช Jest test files
|
|
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",
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
// ๐ Storybook stories
|
|
103
|
+
{
|
|
104
|
+
files: ["**/*.stories.tsx"],
|
|
105
|
+
rules: {
|
|
106
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
95
107
|
},
|
|
96
108
|
},
|
|
97
|
-
|
|
109
|
+
];
|
package/package.json
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mysetup/eslint-config",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1-01",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"clean": "rm -rf node_modules .swc dist pnpm-lock.yaml && echo \"โ
Successfully removed \""
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@
|
|
11
|
-
"@eslint/js": "9.36.0",
|
|
12
|
-
"@mysetup/prettier-config": "^1.3.1",
|
|
13
|
-
"@next/eslint-plugin-next": "^15.5.4",
|
|
10
|
+
"@mysetup/prettier-config": "latest",
|
|
14
11
|
"@vercel/style-guide": "^6.0.0",
|
|
15
|
-
"eslint": "
|
|
16
|
-
"eslint-config-prettier": "^10.1.8",
|
|
17
|
-
"eslint-plugin-prettier": "^5.5.4"
|
|
12
|
+
"eslint-config-prettier": "^10.1.8"
|
|
18
13
|
},
|
|
19
14
|
"devDependencies": {
|
|
20
|
-
"@babel/core": "^7.28.
|
|
21
|
-
"@babel/eslint-parser": "^7.28.
|
|
15
|
+
"@babel/core": "^7.28.5",
|
|
16
|
+
"@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",
|
|
22
25
|
"prettier": "^3.6.2",
|
|
23
|
-
"typescript": "
|
|
26
|
+
"typescript": "5.5.4",
|
|
27
|
+
"typescript-eslint": "^8.46.2"
|
|
24
28
|
},
|
|
25
29
|
"prettier": "@mysetup/prettier-config",
|
|
26
30
|
"engines": {
|