@stanlemon/eslint-config 2.0.3 → 3.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/eslint.config.cjs +145 -0
- package/package.json +16 -11
- /package/{eslint.config.js → eslint.config.mjs} +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// Generated from the ESM version of the file by Claude Haiku
|
|
2
|
+
const globals = require("globals");
|
|
3
|
+
const eslint = require("@eslint/js");
|
|
4
|
+
const tseslint = require("typescript-eslint");
|
|
5
|
+
const prettierPlugin = require("eslint-plugin-prettier/recommended");
|
|
6
|
+
const reactPlugin = require("eslint-plugin-react");
|
|
7
|
+
const importPlugin = require("eslint-plugin-import");
|
|
8
|
+
const jest = require("eslint-plugin-jest");
|
|
9
|
+
const jestDom = require("eslint-plugin-jest-dom");
|
|
10
|
+
|
|
11
|
+
module.exports = tseslint.config(
|
|
12
|
+
{
|
|
13
|
+
ignores: [
|
|
14
|
+
"**/node_modules/",
|
|
15
|
+
".git/",
|
|
16
|
+
"**/dist/",
|
|
17
|
+
// This is an override of @types/pouchdb-core which we want to ignore when linting
|
|
18
|
+
"**/types-pouchdb-core/",
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
eslint.configs.recommended,
|
|
22
|
+
prettierPlugin,
|
|
23
|
+
importPlugin.flatConfigs.react,
|
|
24
|
+
importPlugin.flatConfigs.typescript,
|
|
25
|
+
|
|
26
|
+
reactPlugin.configs.flat.recommended,
|
|
27
|
+
{
|
|
28
|
+
languageOptions: {
|
|
29
|
+
parser: tseslint.parser,
|
|
30
|
+
ecmaVersion: "latest",
|
|
31
|
+
sourceType: "module",
|
|
32
|
+
parserOptions: {
|
|
33
|
+
ecmaFeatures: {
|
|
34
|
+
jsx: true,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
globals: {
|
|
38
|
+
...globals.browser,
|
|
39
|
+
...globals.jest,
|
|
40
|
+
...globals.node,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
plugins: {
|
|
44
|
+
reactPlugin,
|
|
45
|
+
},
|
|
46
|
+
settings: {
|
|
47
|
+
react: {
|
|
48
|
+
version: "detect",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
rules: {
|
|
52
|
+
// Requires strict equality
|
|
53
|
+
eqeqeq: "error",
|
|
54
|
+
// If functions are too long, break them up into smaller ones
|
|
55
|
+
"max-lines-per-function": [
|
|
56
|
+
"error",
|
|
57
|
+
{
|
|
58
|
+
max: 80,
|
|
59
|
+
skipBlankLines: true,
|
|
60
|
+
skipComments: true,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
// Linting shouldn't break on this, but we also want to discourage using console logging
|
|
64
|
+
"no-console": ["warn", { allow: ["warn", "error"] }],
|
|
65
|
+
// Requires the displayName property to be set, not ideal for stateless components
|
|
66
|
+
"no-unused-vars": [
|
|
67
|
+
"warn",
|
|
68
|
+
{
|
|
69
|
+
caughtErrors: "none",
|
|
70
|
+
destructuredArrayIgnorePattern: "^_",
|
|
71
|
+
ignoreRestSiblings: true,
|
|
72
|
+
args: "none",
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
"no-empty-function": "off",
|
|
76
|
+
"react/display-name": "off",
|
|
77
|
+
"react/react-in-jsx-scope": "off",
|
|
78
|
+
"react/jsx-uses-react": "off",
|
|
79
|
+
"react/prop-types": "off",
|
|
80
|
+
"react/no-unescaped-entities": ["error", { forbid: [">", "}"] }],
|
|
81
|
+
"prettier/prettier": [
|
|
82
|
+
"error",
|
|
83
|
+
{
|
|
84
|
+
trailingComma: "es5",
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
91
|
+
extends: [...tseslint.configs.recommended],
|
|
92
|
+
/*
|
|
93
|
+
languageOptions: {
|
|
94
|
+
parserOptions: {
|
|
95
|
+
projectService: {
|
|
96
|
+
allowDefaultProject: ['*.ts', '*.tsx'],
|
|
97
|
+
},
|
|
98
|
+
tsconfigRootDir: import.meta.dirname,
|
|
99
|
+
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
*/
|
|
103
|
+
rules: {
|
|
104
|
+
"@typescript-eslint/no-unused-vars": [
|
|
105
|
+
"warn",
|
|
106
|
+
{
|
|
107
|
+
caughtErrors: "none",
|
|
108
|
+
destructuredArrayIgnorePattern: "^_",
|
|
109
|
+
ignoreRestSiblings: true,
|
|
110
|
+
args: "none",
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
114
|
+
// Do not require 'public' before public methods
|
|
115
|
+
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
files: ["**/*.jsx", "**/*.tsx"],
|
|
120
|
+
rules: {
|
|
121
|
+
"max-lines-per-function": [
|
|
122
|
+
"error",
|
|
123
|
+
{
|
|
124
|
+
max: 160, // Twice as long as normal
|
|
125
|
+
skipBlankLines: true,
|
|
126
|
+
skipComments: true,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
files: [
|
|
133
|
+
"**/*.test.js",
|
|
134
|
+
"**/*.test.ts",
|
|
135
|
+
"**/*.test.tsx",
|
|
136
|
+
"jest.setup.js",
|
|
137
|
+
"jest.config.js",
|
|
138
|
+
],
|
|
139
|
+
...jestDom.configs["flat/recommended"],
|
|
140
|
+
...jest.configs["flat/recommended"],
|
|
141
|
+
rules: {
|
|
142
|
+
"max-lines-per-function": "off",
|
|
143
|
+
},
|
|
144
|
+
}
|
|
145
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stanlemon/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "My typical eslint setup, but without all the copy and paste.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint"
|
|
@@ -8,30 +8,35 @@
|
|
|
8
8
|
"author": "Stan Lemon <stanlemon@users.noreply.github.com>",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"engines": {
|
|
11
|
-
"node": "
|
|
11
|
+
"node": "^20.0.0"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
|
-
"
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"require": "./eslint.config.cjs",
|
|
17
|
+
"import": "./eslint.config.mjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
15
20
|
"scripts": {
|
|
16
21
|
"lint": "eslint .",
|
|
17
22
|
"lint:fix": "eslint --fix ."
|
|
18
23
|
},
|
|
19
24
|
"dependencies": {
|
|
20
|
-
"@eslint/js": "^9.
|
|
25
|
+
"@eslint/js": "^9.16.0",
|
|
21
26
|
"@types/eslint__js": "^8.42.3",
|
|
22
|
-
"eslint": "^9.
|
|
27
|
+
"eslint": "^9.16.0",
|
|
23
28
|
"eslint-config-prettier": "^9.1.0",
|
|
24
29
|
"eslint-config-react": "^1.1.7",
|
|
25
30
|
"eslint-config-typescript": "^3.0.0",
|
|
26
31
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
27
32
|
"eslint-plugin-import": "^2.31.0",
|
|
28
|
-
"eslint-plugin-jest": "^28.
|
|
29
|
-
"eslint-plugin-jest-dom": "^5.
|
|
33
|
+
"eslint-plugin-jest": "^28.9.0",
|
|
34
|
+
"eslint-plugin-jest-dom": "^5.5.0",
|
|
30
35
|
"eslint-plugin-prettier": "^5.2.1",
|
|
31
36
|
"eslint-plugin-react": "^7.37.2",
|
|
32
|
-
"globals": "^15.
|
|
33
|
-
"prettier": "^3.
|
|
34
|
-
"typescript": "^5.
|
|
35
|
-
"typescript-eslint": "^8.
|
|
37
|
+
"globals": "^15.12.0",
|
|
38
|
+
"prettier": "^3.4.1",
|
|
39
|
+
"typescript": "^5.7.2",
|
|
40
|
+
"typescript-eslint": "^8.16.0"
|
|
36
41
|
}
|
|
37
42
|
}
|
|
File without changes
|