@shayanthenerd/eslint-config 0.12.1 → 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 +4 -2
- package/package.json +18 -16
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>;
|
|
@@ -12078,6 +12079,7 @@ type PerfectionistSortVariableDeclarations = [] | [{
|
|
|
12078
12079
|
// ----- playwright/expect-expect -----
|
|
12079
12080
|
type PlaywrightExpectExpect = [] | [{
|
|
12080
12081
|
assertFunctionNames?: [] | [string];
|
|
12082
|
+
assertFunctionPatterns?: [] | [string];
|
|
12081
12083
|
}];
|
|
12082
12084
|
// ----- playwright/max-expects -----
|
|
12083
12085
|
type PlaywrightMaxExpects = [] | [{
|
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",
|
|
@@ -84,39 +86,39 @@
|
|
|
84
86
|
"@eslint/css": "0.14.1",
|
|
85
87
|
"@html-eslint/eslint-plugin": "0.50.0",
|
|
86
88
|
"@stylistic/eslint-plugin": "5.6.1",
|
|
87
|
-
"@vitest/eslint-plugin": "1.5.
|
|
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.1.
|
|
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
112
|
"@eslint/config-inspector": "1.4.2",
|
|
111
|
-
"@types/node": "
|
|
112
|
-
"actions-up": "1.
|
|
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.7.
|
|
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
|
}
|