1818
1919<br >
2020
21- ## Setup
21+ ## Usage
22+
23+ ### Linting Commands
2224
23- Add ` lint ` commands for manual linting (optionally ):
25+ Add ` lint ` commands for manual linting (optional ):
2426
2527``` js
2628// package.json
@@ -33,33 +35,36 @@ Add `lint` commands for manual linting (optionally):
3335}
3436```
3537
36- ## Usage
37-
38- ### JS
38+ ### JavaScript Config
3939
4040``` js
4141// eslint.config.js
4242
43- import { jsConfig , ignoresConfig } from ' @hypernym/eslint-config'
43+ import { defineConfig , jsConfig , ignoresConfig } from ' @hypernym/eslint-config'
4444
45- export default [jsConfig, ignoresConfig]
45+ export default defineConfig ( [jsConfig, ignoresConfig])
4646```
4747
48- ### TS
48+ ### TypeScript Config
4949
5050``` js
5151// eslint.config.js
5252
53- import { jsConfig , tsConfig , ignoresConfig } from ' @hypernym/eslint-config'
53+ import {
54+ defineConfig ,
55+ jsConfig ,
56+ tsConfig ,
57+ ignoresConfig ,
58+ } from ' @hypernym/eslint-config'
5459
55- export default [jsConfig, tsConfig, ignoresConfig]
60+ export default defineConfig ( [jsConfig, tsConfig, ignoresConfig])
5661```
5762
58- ### Svelte/SvelteKit
63+ ### Svelte/SvelteKit Config
5964
6065> [ !NOTE]
6166>
62- > Install the required ` Svelte ` dev dependencies before using:
67+ > Install the required ` Svelte ` dependencies before using:
6368>
6469> ``` sh
6570> pnpm add -D eslint-plugin-svelte svelte-eslint-parser
@@ -78,20 +83,25 @@ export default [jsConfig, tsConfig, ignoresConfig]
7883```js
7984// eslint.config.js
8085
81- import { jsConfig, tsConfig, ignoresConfig } from ' @hypernym/eslint-config'
86+ import {
87+ defineConfig,
88+ jsConfig,
89+ tsConfig,
90+ ignoresConfig,
91+ } from ' @hypernym/eslint-config'
8292import { svelteConfig } from ' @hypernym/eslint-config/svelte'
8393
84- export default [jsConfig, tsConfig, svelteConfig, ignoresConfig]
94+ export default defineConfig( [jsConfig, tsConfig, svelteConfig, ignoresConfig])
8595```
8696
87- ### Vue/Nuxt
97+ ### Vue/Nuxt Config
8898
8999> [!NOTE]
90100>
91- > Install the required `Vue` dev dependencies before using:
101+ > Install the required `Vue` dependencies before using:
92102>
93103> ```sh
94- > pnpm add -D eslint-plugin-vue
104+ > pnpm add -D eslint-plugin-vue vue-eslint-parser
95105> ```
96106>
97107> Also, don' t forget to add the ` vue` lang key to the ` eslint.validate` vscode setting:
@@ -107,17 +117,22 @@ export default [jsConfig, tsConfig, svelteConfig, ignoresConfig]
107117` ` ` js
108118// eslint.config.js
109119
110- import { jsConfig, tsConfig, ignoresConfig } from ' @hypernym/eslint-config'
120+ import {
121+ defineConfig,
122+ jsConfig,
123+ tsConfig,
124+ ignoresConfig,
125+ } from ' @hypernym/eslint-config'
111126import { vueConfig } from ' @hypernym/eslint-config/vue'
112127
113- export default [jsConfig, tsConfig, vueConfig, ignoresConfig]
128+ export default defineConfig( [jsConfig, tsConfig, vueConfig, ignoresConfig])
114129` ` `
115130
116- # ## React/Next
131+ # ## React/Next Config
117132
118133> [! NOTE]
119134>
120- > Install the required ` React` dev dependencies before using:
135+ > Install the required ` React` dependencies before using:
121136>
122137> ` ` ` sh
123138> pnpm add -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-refresh
@@ -136,20 +151,26 @@ export default [jsConfig, tsConfig, vueConfig, ignoresConfig]
136151```js
137152// eslint.config.js
138153
139- import { ignoresConfig } from ' @hypernym/eslint-config'
154+ import { defineConfig, ignoresConfig } from ' @hypernym/eslint-config'
140155import { jsxConfig, tsxConfig } from ' @hypernym/eslint-config/react'
141156
142- export default [jsxConfig, tsxConfig, ignoresConfig]
157+ export default defineConfig( [jsxConfig, tsxConfig, ignoresConfig])
143158```
144159
145- ### Custom
160+ ## Custom Setup
146161
147162```js
148163// eslint.config.js
149164
150- import { jsConfig, tsConfig, ignores } from ' @hypernym/eslint-config'
165+ import {
166+ defineConfig,
167+ globalIgnores,
168+ jsConfig,
169+ tsConfig,
170+ ignores,
171+ } from ' @hypernym/eslint-config'
151172
152- export default [
173+ export default defineConfig( [
153174 jsConfig,
154175 tsConfig,
155176 {
@@ -162,12 +183,12 @@ export default [
162183 ],
163184 },
164185 },
165- {
166- ignores: [...ignores, ' ** /dir/** /* ' ],
167- },
168- ]
186+ globalIgnores([...ignores, ' ** /dir/' ]),
187+ ])
169188```
170189
190+ For more info on how to `ignore files`, see the official [docs](https://eslint.org/docs/latest/use/configure/ignore).
191+
171192## Community
172193
173194Feel free to ask questions or share new ideas.
0 commit comments