@shayanthenerd/eslint-config 0.26.3 → 0.26.4
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 +2 -1
- package/dist/rules/javascript.mjs +7 -3
- package/dist/rules/tailwind.mjs +27 -25
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -231,8 +231,9 @@ Some rules depend on the specified Node.js version. Visit the documentation for
|
|
|
231
231
|
|
|
232
232
|
## IDE Support
|
|
233
233
|
Install the VS Code extensions for [ESLint][extension-eslint] and [Prettier][extension-prettier].
|
|
234
|
+
|
|
234
235
|
> [!TIP]
|
|
235
|
-
> In case you're using PNPM without `shamefullyHoist: true
|
|
236
|
+
> In case you're using PNPM without `shamefullyHoist: true` and ESLint's VS Code extension isn't working as expected, add the following to your _pnpm-workspace.yaml_ and run `pnpm install --yes`:
|
|
236
237
|
> ```yaml title="pnpm-workspace.yaml"
|
|
237
238
|
> publicHoistPattern:
|
|
238
239
|
> - '*eslint*'
|
|
@@ -82,7 +82,7 @@ function getJavaScriptRules(options) {
|
|
|
82
82
|
"consistent-return": isTypeScriptEnabled ? "off" : "error",
|
|
83
83
|
"consistent-this": "error",
|
|
84
84
|
"curly": "warn",
|
|
85
|
-
"default-case": "warn",
|
|
85
|
+
"default-case": isTypeScriptEnabled ? "off" : "warn",
|
|
86
86
|
"default-case-last": "warn",
|
|
87
87
|
"default-param-last": isTypeScriptEnabled ? "off" : "warn",
|
|
88
88
|
"dot-notation": isTypeScriptEnabled ? "off" : "warn",
|
|
@@ -164,10 +164,14 @@ function getJavaScriptRules(options) {
|
|
|
164
164
|
"no-setter-return": isTypeScriptEnabled ? "off" : "error",
|
|
165
165
|
"no-shadow": ["error", {
|
|
166
166
|
hoist: "all",
|
|
167
|
-
allow: ["name"],
|
|
168
167
|
builtinGlobals: true,
|
|
169
168
|
ignoreTypeValueShadow: false,
|
|
170
|
-
ignoreFunctionTypeParameterNameValueShadow: false
|
|
169
|
+
ignoreFunctionTypeParameterNameValueShadow: false,
|
|
170
|
+
allow: [
|
|
171
|
+
"name",
|
|
172
|
+
"event",
|
|
173
|
+
"status"
|
|
174
|
+
]
|
|
171
175
|
}],
|
|
172
176
|
"no-shadow-restricted-names": "warn",
|
|
173
177
|
"no-sparse-arrays": "error",
|
package/dist/rules/tailwind.mjs
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
3
|
//#region src/rules/tailwind.ts
|
|
4
|
-
const
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
]
|
|
4
|
+
const nonLogicalTailwindUtilityPatterns = [
|
|
5
|
+
"-?top(?:-.+)?",
|
|
6
|
+
"-?bottom(?:-.+)?",
|
|
7
|
+
"pt-.+",
|
|
8
|
+
"pb-.+",
|
|
9
|
+
"-?mt-.+",
|
|
10
|
+
"-?mb-.+",
|
|
11
|
+
"border-t(?:-.+)?",
|
|
12
|
+
"border-b(?:-.+)?",
|
|
13
|
+
"w-.+",
|
|
14
|
+
"min-w-.+",
|
|
15
|
+
"max-w-.+",
|
|
16
|
+
"h-.+",
|
|
17
|
+
"min-h-.+",
|
|
18
|
+
"max-h-.+",
|
|
19
|
+
"overflow-x-.+",
|
|
20
|
+
"overflow-y-.+",
|
|
21
|
+
"overscroll-x-.+",
|
|
22
|
+
"overscroll-y-.+",
|
|
23
|
+
"scroll-pt-.+",
|
|
24
|
+
"scroll-pb-.+",
|
|
25
|
+
"-?scroll-mt-.+",
|
|
26
|
+
"-?scroll-mb-.+"
|
|
27
|
+
].map((pattern) => {
|
|
28
|
+
return `^(?:\\S+:)*(?:!${pattern}|${pattern}!?)$`;
|
|
29
|
+
});
|
|
28
30
|
function getTailwindRules(options) {
|
|
29
31
|
const { tailwind, stylistic } = options.configs;
|
|
30
32
|
const { multilineSort, ignoredUnknownClasses: userIgnoredUnknownClasses } = isEnabled(tailwind) ? tailwind : defaultOptions.configs.tailwind;
|
|
@@ -41,7 +43,7 @@ function getTailwindRules(options) {
|
|
|
41
43
|
printWidth: maxLineLength
|
|
42
44
|
}],
|
|
43
45
|
"better-tailwindcss/enforce-consistent-variant-order": "warn",
|
|
44
|
-
"better-tailwindcss/enforce-logical-properties": ["warn", { ignore:
|
|
46
|
+
"better-tailwindcss/enforce-logical-properties": ["warn", { ignore: nonLogicalTailwindUtilityPatterns }],
|
|
45
47
|
"better-tailwindcss/no-duplicate-classes": "error",
|
|
46
48
|
"better-tailwindcss/no-deprecated-classes": "error",
|
|
47
49
|
"better-tailwindcss/no-unnecessary-whitespace": "warn",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shayanthenerd/eslint-config",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.4",
|
|
4
4
|
"description": "A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"{**/*.ts,package.json}": "pnpm lint"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@eslint-react/eslint-plugin": "5.10.
|
|
55
|
+
"@eslint-react/eslint-plugin": "5.10.2",
|
|
56
56
|
"@eslint/css": "1.4.0",
|
|
57
57
|
"@eslint/markdown": "8.0.3",
|
|
58
58
|
"@html-eslint/eslint-plugin": "0.63.0",
|
|
59
59
|
"@html-eslint/eslint-plugin-react": "0.63.0",
|
|
60
|
-
"@next/eslint-plugin-next": "16.2.
|
|
60
|
+
"@next/eslint-plugin-next": "16.2.10",
|
|
61
61
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
62
62
|
"@vitest/eslint-plugin": "1.6.20",
|
|
63
63
|
"astro-eslint-parser": "2.1.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"eslint-import-resolver-typescript": "4.4.5",
|
|
67
67
|
"eslint-plugin-astro": "2.1.1",
|
|
68
68
|
"eslint-plugin-baseline-js": "0.6.2",
|
|
69
|
-
"eslint-plugin-better-tailwindcss": "4.6.
|
|
69
|
+
"eslint-plugin-better-tailwindcss": "4.6.1",
|
|
70
70
|
"eslint-plugin-cypress": "6.4.2",
|
|
71
71
|
"eslint-plugin-import-x": "4.17.1",
|
|
72
72
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@eslint/config-inspector": "3.0.4",
|
|
92
92
|
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
93
93
|
"@types/node": "26.1.0",
|
|
94
|
-
"actions-up": "1.
|
|
94
|
+
"actions-up": "1.16.0",
|
|
95
95
|
"eslint": "10.6.0",
|
|
96
96
|
"eslint-typegen": "2.3.1",
|
|
97
97
|
"nano-staged": "1.0.2",
|