@mysetup/eslint-config 2.0.1-2 → 2.0.1-3
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 +97 -0
- package/package.json +28 -34
- package/index.mjs +0 -109
package/index.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const project = ["**/tsconfig.json"];
|
|
2
|
+
|
|
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
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
files: [
|
|
59
|
+
"**/__fixtures__/*.ts",
|
|
60
|
+
"**/__mocks__/*.ts",
|
|
61
|
+
"*.test.ts",
|
|
62
|
+
"*.test.tsx",
|
|
63
|
+
],
|
|
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",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
files: ["*.stories.tsx"],
|
|
79
|
+
parserOptions: {
|
|
80
|
+
project,
|
|
81
|
+
},
|
|
82
|
+
rules: {
|
|
83
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
settings: {
|
|
88
|
+
react: {
|
|
89
|
+
version: "18.3.1",
|
|
90
|
+
},
|
|
91
|
+
"import/resolver": {
|
|
92
|
+
typescript: {
|
|
93
|
+
project: ["apps/*/tsconfig.json", "packages/*/tsconfig.json"],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
};
|
package/package.json
CHANGED
|
@@ -1,34 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@mysetup/eslint-config",
|
|
3
|
-
"version": "2.0.1-
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"clean": "rm -rf node_modules .swc dist pnpm-lock.yaml && echo \"✅ Successfully removed \""
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@mysetup/prettier-config": "latest",
|
|
11
|
-
"@
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"@
|
|
19
|
-
"eslint": "
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"prettier": "@mysetup/prettier-config",
|
|
30
|
-
"engines": {
|
|
31
|
-
"node": ">=18.0.0"
|
|
32
|
-
},
|
|
33
|
-
"packageManager": "pnpm@9.9.0"
|
|
34
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@mysetup/eslint-config",
|
|
3
|
+
"version": "2.0.1-3",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"clean": "rm -rf node_modules .swc dist pnpm-lock.yaml && echo \"✅ Successfully removed \""
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@mysetup/prettier-config": "latest",
|
|
11
|
+
"@next/eslint-plugin-next": "^15.5.4",
|
|
12
|
+
"@vercel/style-guide": "^6.0.0",
|
|
13
|
+
"eslint": "9.36.0",
|
|
14
|
+
"eslint-config-prettier": "^10.1.8",
|
|
15
|
+
"eslint-plugin-prettier": "^5.5.4"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@babel/core": "^7.28.4",
|
|
19
|
+
"@babel/eslint-parser": "^7.28.4",
|
|
20
|
+
"prettier": "^3.6.2",
|
|
21
|
+
"typescript": "5.5.4"
|
|
22
|
+
},
|
|
23
|
+
"prettier": "@mysetup/prettier-config",
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18.0.0"
|
|
26
|
+
},
|
|
27
|
+
"packageManager": "pnpm@9.9.0"
|
|
28
|
+
}
|
package/index.mjs
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
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
|
-
const project = ["**/tsconfig.json"];
|
|
12
|
-
|
|
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,
|
|
26
|
-
},
|
|
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
|
-
},
|
|
44
|
-
],
|
|
45
|
-
"react/jsx-key": "off",
|
|
46
|
-
"react/no-unescaped-entities": "off",
|
|
47
|
-
"unicorn/filename-case": "off",
|
|
48
|
-
},
|
|
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
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
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",
|
|
80
|
-
},
|
|
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",
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
];
|