@shayanthenerd/eslint-config 0.12.0 → 0.13.0
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 +16 -4
- package/dist/rules/stylistic.mjs +1 -0
- package/dist/types/eslint-schema.d.mts +23 -3
- package/dist/types/index.d.mts +1 -1
- package/package.json +20 -18
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style.
|
|
4
4
|
|
|
5
|
-
- **Performant**: Powered by [OXLint](https://oxc.rs/docs/guide/usage/linter) for rapid linting
|
|
5
|
+
- **Performant**: Powered by [OXLint (OXC Linter)](https://oxc.rs/docs/guide/usage/linter) for rapid linting
|
|
6
6
|
- **Flat Config**: Type-safe [ESLint Flat Config](https://eslint.org/docs/latest/use/configure/configuration-files) with `extends` and `overrides` support
|
|
7
7
|
- **Comprehensive**: Dependency detection with support for TypeScript, Vue & Nuxt, Tailwind, Storybook, Vitest & Playwright, and more
|
|
8
8
|
- **Automatic Formatting**: Fine-grained control over formatting with [ESLint Stylistic](https://eslint.style), eliminating the need for Prettier
|
|
@@ -138,17 +138,29 @@ This config uses [ESLint Stylistic](https://eslint.style) to format JavaScript a
|
|
|
138
138
|
npm i -D prettier
|
|
139
139
|
```
|
|
140
140
|
|
|
141
|
-
2. Create a Prettier config file
|
|
141
|
+
2. Create a Prettier config file in the root of your project (_prettier.config.js_):
|
|
142
142
|
```js
|
|
143
143
|
import prettierConfig from '@shayanthenerd/eslint-config/prettier';
|
|
144
144
|
|
|
145
145
|
/** @type {import('prettier').Config} */
|
|
146
146
|
export default {
|
|
147
147
|
...prettierConfig,
|
|
148
|
-
semi: false, // Override
|
|
148
|
+
semi: false, // Override `semi` from the shared config
|
|
149
149
|
};
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
+
Or if you prefer using TypeScrpit (_prettier.config.ts_):
|
|
153
|
+
```ts
|
|
154
|
+
import type { Config } from 'prettier';
|
|
155
|
+
|
|
156
|
+
import prettierConfig from '@shayanthenerd/eslint-config/prettier';
|
|
157
|
+
|
|
158
|
+
export default {
|
|
159
|
+
...prettierConfig,
|
|
160
|
+
semi: true, // Override `semi` from the shared config
|
|
161
|
+
} satisfies Config;
|
|
162
|
+
```
|
|
163
|
+
|
|
152
164
|
3. To prevent conflicts with ESLint, Prettier should be configured to only format files other than JavaScript, TypeScript, HTML, and Vue. Hence, add the following script to your _package.json_ file:
|
|
153
165
|
```json
|
|
154
166
|
{
|
|
@@ -259,7 +271,7 @@ Since OXLint and ESLint use separate config files, customizations made in your E
|
|
|
259
271
|
|
|
260
272
|
`defineConfig` takes the `options` object as the first argument. `options` is thoroughly documented with JSDoc, and provides many options for rule customizations. In addition, each config object in `options.configs` accepts an `overrides` option:
|
|
261
273
|
```ts
|
|
262
|
-
interface
|
|
274
|
+
interface Overrides {
|
|
263
275
|
name: '',
|
|
264
276
|
files: [],
|
|
265
277
|
ignores: [],
|
package/dist/rules/stylistic.mjs
CHANGED
|
@@ -20,6 +20,7 @@ function getStylisticRules(options) {
|
|
|
20
20
|
"@stylistic/comma-spacing": "warn",
|
|
21
21
|
"@stylistic/comma-style": "warn",
|
|
22
22
|
"@stylistic/computed-property-spacing": "warn",
|
|
23
|
+
"@stylistic/dot-location": ["warn", "property"],
|
|
23
24
|
"@stylistic/eol-last": "warn",
|
|
24
25
|
"@stylistic/exp-list-style": "warn",
|
|
25
26
|
"@stylistic/function-call-argument-newline": ["warn", "consistent"],
|
|
@@ -30,6 +30,7 @@ declare module 'eslint-flat-config-utils' {
|
|
|
30
30
|
'shayanthenerd/vitest'?: true;
|
|
31
31
|
'shayanthenerd/cypress'?: true;
|
|
32
32
|
'shayanthenerd/playwright'?: true;
|
|
33
|
+
'oxlint/oxlint-config-ignore-patterns'?: true;
|
|
33
34
|
'oxlint/from-oxlint-config'?: true;
|
|
34
35
|
'oxlint/from-oxlint-config-override-0'?: true;
|
|
35
36
|
'shayanthenerd/oxlint/overrides'?: true;
|
|
@@ -1515,7 +1516,7 @@ interface ESLintSchema {
|
|
|
1515
1516
|
'better-tailwindcss/enforce-consistent-important-position'?: Linter.RuleEntry<BetterTailwindcssEnforceConsistentImportantPosition>;
|
|
1516
1517
|
/**
|
|
1517
1518
|
* Enforce consistent line wrapping for tailwind classes.
|
|
1518
|
-
* @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/
|
|
1519
|
+
* @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-line-wrapping.md
|
|
1519
1520
|
*/
|
|
1520
1521
|
'better-tailwindcss/enforce-consistent-line-wrapping'?: Linter.RuleEntry<BetterTailwindcssEnforceConsistentLineWrapping>;
|
|
1521
1522
|
/**
|
|
@@ -1530,7 +1531,7 @@ interface ESLintSchema {
|
|
|
1530
1531
|
'better-tailwindcss/enforce-shorthand-classes'?: Linter.RuleEntry<BetterTailwindcssEnforceShorthandClasses>;
|
|
1531
1532
|
/**
|
|
1532
1533
|
* Enforce consistent line wrapping for tailwind classes.
|
|
1533
|
-
* @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/
|
|
1534
|
+
* @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-line-wrapping.md
|
|
1534
1535
|
* @deprecated
|
|
1535
1536
|
*/
|
|
1536
1537
|
'better-tailwindcss/multiline'?: Linter.RuleEntry<BetterTailwindcssMultiline>;
|
|
@@ -3875,6 +3876,11 @@ interface ESLintSchema {
|
|
|
3875
3876
|
* @see https://eslint.org/docs/latest/rules/vars-on-top
|
|
3876
3877
|
*/
|
|
3877
3878
|
'vars-on-top'?: Linter.RuleEntry<[]>;
|
|
3879
|
+
/**
|
|
3880
|
+
* enforce using `.each` or `.for` consistently
|
|
3881
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-each-for.md
|
|
3882
|
+
*/
|
|
3883
|
+
'vitest/consistent-each-for'?: Linter.RuleEntry<VitestConsistentEachFor>;
|
|
3878
3884
|
/**
|
|
3879
3885
|
* require test file pattern
|
|
3880
3886
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
@@ -4092,7 +4098,7 @@ interface ESLintSchema {
|
|
|
4092
4098
|
*/
|
|
4093
4099
|
'vitest/prefer-each'?: Linter.RuleEntry<[]>;
|
|
4094
4100
|
/**
|
|
4095
|
-
* enforce using the built-in
|
|
4101
|
+
* enforce using the built-in equality matchers
|
|
4096
4102
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
|
|
4097
4103
|
*/
|
|
4098
4104
|
'vitest/prefer-equality-matcher'?: Linter.RuleEntry<[]>;
|
|
@@ -4211,6 +4217,11 @@ interface ESLintSchema {
|
|
|
4211
4217
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
|
|
4212
4218
|
*/
|
|
4213
4219
|
'vitest/require-hook'?: Linter.RuleEntry<VitestRequireHook>;
|
|
4220
|
+
/**
|
|
4221
|
+
* require usage of import in vi.mock()
|
|
4222
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-import-vi-mock.md
|
|
4223
|
+
*/
|
|
4224
|
+
'vitest/require-import-vi-mock'?: Linter.RuleEntry<[]>;
|
|
4214
4225
|
/**
|
|
4215
4226
|
* require local Test Context for concurrent snapshot tests
|
|
4216
4227
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
|
|
@@ -5640,6 +5651,7 @@ type HtmlEslintIndent = [] | [("tab" | number)] | [("tab" | number), {
|
|
|
5640
5651
|
[k: string]: number;
|
|
5641
5652
|
};
|
|
5642
5653
|
ignoreComment?: boolean;
|
|
5654
|
+
templateIndentBase?: ("first" | "templateTag");
|
|
5643
5655
|
}];
|
|
5644
5656
|
// ----- @html-eslint/max-element-depth -----
|
|
5645
5657
|
type HtmlEslintMaxElementDepth = [] | [{
|
|
@@ -12067,6 +12079,7 @@ type PerfectionistSortVariableDeclarations = [] | [{
|
|
|
12067
12079
|
// ----- playwright/expect-expect -----
|
|
12068
12080
|
type PlaywrightExpectExpect = [] | [{
|
|
12069
12081
|
assertFunctionNames?: [] | [string];
|
|
12082
|
+
assertFunctionPatterns?: [] | [string];
|
|
12070
12083
|
}];
|
|
12071
12084
|
// ----- playwright/max-expects -----
|
|
12072
12085
|
type PlaywrightMaxExpects = [] | [{
|
|
@@ -12356,6 +12369,13 @@ type UseIsnan = [] | [{
|
|
|
12356
12369
|
type ValidTypeof = [] | [{
|
|
12357
12370
|
requireStringLiterals?: boolean;
|
|
12358
12371
|
}];
|
|
12372
|
+
// ----- vitest/consistent-each-for -----
|
|
12373
|
+
type VitestConsistentEachFor = [] | [{
|
|
12374
|
+
test?: ("each" | "for");
|
|
12375
|
+
it?: ("each" | "for");
|
|
12376
|
+
describe?: ("each" | "for");
|
|
12377
|
+
suite?: ("each" | "for");
|
|
12378
|
+
}];
|
|
12359
12379
|
// ----- vitest/consistent-test-filename -----
|
|
12360
12380
|
type VitestConsistentTestFilename = [] | [{
|
|
12361
12381
|
pattern?: string;
|
package/dist/types/index.d.mts
CHANGED
|
@@ -303,7 +303,7 @@ interface Options {
|
|
|
303
303
|
*
|
|
304
304
|
* @default false
|
|
305
305
|
*/
|
|
306
|
-
tailwind?: false |
|
|
306
|
+
tailwind?: false | TailwindOptions;
|
|
307
307
|
|
|
308
308
|
/**
|
|
309
309
|
* Use [typescript-eslint](https://typescript-eslint.io) to enforce TypeScript-specific rules.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shayanthenerd/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style",
|
|
6
6
|
"keywords": [
|
|
@@ -50,9 +50,11 @@
|
|
|
50
50
|
},
|
|
51
51
|
"type": "module",
|
|
52
52
|
"engines": {
|
|
53
|
-
"
|
|
53
|
+
"name": "node",
|
|
54
|
+
"version": "^22.12.0",
|
|
55
|
+
"onfail": "download"
|
|
54
56
|
},
|
|
55
|
-
"packageManager": "pnpm@10.
|
|
57
|
+
"packageManager": "pnpm@10.25.0",
|
|
56
58
|
"scripts": {
|
|
57
59
|
"prepare": "pnpm git:gitmessage && simple-git-hooks && pnpm generate:types",
|
|
58
60
|
"prepublishOnly": "pnpm build:package",
|
|
@@ -82,41 +84,41 @@
|
|
|
82
84
|
"dependencies": {
|
|
83
85
|
"@eslint/compat": "2.0.0",
|
|
84
86
|
"@eslint/css": "0.14.1",
|
|
85
|
-
"@html-eslint/eslint-plugin": "0.
|
|
87
|
+
"@html-eslint/eslint-plugin": "0.50.0",
|
|
86
88
|
"@stylistic/eslint-plugin": "5.6.1",
|
|
87
|
-
"@vitest/eslint-plugin": "1.
|
|
89
|
+
"@vitest/eslint-plugin": "1.5.2",
|
|
88
90
|
"defu": "6.1.4",
|
|
89
91
|
"eslint": "9.39.1",
|
|
90
92
|
"eslint-flat-config-utils": "2.1.4",
|
|
91
93
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
92
|
-
"eslint-plugin-better-tailwindcss": "3.
|
|
94
|
+
"eslint-plugin-better-tailwindcss": "3.8.0",
|
|
93
95
|
"eslint-plugin-cypress": "5.2.0",
|
|
94
96
|
"eslint-plugin-import-x": "4.16.1",
|
|
95
|
-
"eslint-plugin-oxlint": "1.
|
|
97
|
+
"eslint-plugin-oxlint": "1.32.0",
|
|
96
98
|
"eslint-plugin-perfectionist": "4.15.1",
|
|
97
|
-
"eslint-plugin-playwright": "2.
|
|
98
|
-
"eslint-plugin-storybook": "10.
|
|
99
|
+
"eslint-plugin-playwright": "2.4.0",
|
|
100
|
+
"eslint-plugin-storybook": "10.1.6",
|
|
99
101
|
"eslint-plugin-unused-imports": "4.3.0",
|
|
100
|
-
"eslint-plugin-vue": "10.6.
|
|
102
|
+
"eslint-plugin-vue": "10.6.2",
|
|
101
103
|
"eslint-plugin-vuejs-accessibility": "2.4.1",
|
|
102
104
|
"globals": "16.5.0",
|
|
103
105
|
"local-pkg": "1.1.2",
|
|
104
|
-
"oxlint": "1.
|
|
106
|
+
"oxlint": "1.32.0",
|
|
105
107
|
"tailwind-csstree": "0.1.4",
|
|
106
|
-
"typescript-eslint": "8.
|
|
108
|
+
"typescript-eslint": "8.49.0"
|
|
107
109
|
},
|
|
108
110
|
"devDependencies": {
|
|
109
111
|
"@arethetypeswrong/cli": "0.18.2",
|
|
110
|
-
"@eslint/config-inspector": "1.
|
|
111
|
-
"@types/node": "
|
|
112
|
-
"actions-up": "1.
|
|
112
|
+
"@eslint/config-inspector": "1.4.2",
|
|
113
|
+
"@types/node": "25.0.0",
|
|
114
|
+
"actions-up": "1.7.0",
|
|
113
115
|
"eslint-typegen": "2.3.0",
|
|
114
116
|
"nano-staged": "0.9.0",
|
|
115
|
-
"prettier": "3.
|
|
116
|
-
"publint": "0.3.
|
|
117
|
+
"prettier": "3.7.4",
|
|
118
|
+
"publint": "0.3.16",
|
|
117
119
|
"serve": "14.2.5",
|
|
118
120
|
"simple-git-hooks": "2.13.1",
|
|
119
|
-
"tsdown": "0.
|
|
121
|
+
"tsdown": "0.17.2",
|
|
120
122
|
"typescript": "5.9.3",
|
|
121
123
|
"unplugin-unused": "0.5.6"
|
|
122
124
|
}
|