@nelsonlaidev/eslint-config 0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Nelson Lai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # @nelsonlaidev/eslint-config
2
+
3
+ Personal ESLint configurations for Nelson Lai projects.
4
+
5
+ ## ESLint
6
+
7
+ Create an `eslint.config.ts` file with the following content:
8
+
9
+ ```js
10
+ import { defineConfig } from '@nelsonlaidev/eslint-config'
11
+
12
+ export default defineConfig({
13
+ // Custom ESLint configuration options
14
+ })
15
+ ```
16
+
17
+ ### Options
18
+
19
+ ```ts
20
+ type Options = {
21
+ // Required
22
+ // The root directory of the TypeScript configuration
23
+ tsconfigRootDir: string
24
+ // Optional
25
+ // Enable React specific linting rules
26
+ react?: boolean
27
+ // Optional
28
+ // Enable Next.js specific linting rules
29
+ nextjs?: boolean
30
+ // Optional
31
+ // Specify the entry point for Tailwind CSS (also enable ESLint rules for tailwindcss)
32
+ tailwindEntryPoint?: string
33
+ // Optional
34
+ // Specify glob patterns for Vitest (also enable ESLint rules for vitest)
35
+ vitestGlob?: string
36
+ // Optional
37
+ // Specify glob patterns for Playwright (also enable ESLint rules for playwright)
38
+ playwrightGlob?: string
39
+ // Optional
40
+ // Specify files to ignore
41
+ ignores?: string[]
42
+ }
43
+ ```
@@ -0,0 +1,16 @@
1
+ import { FlatConfigComposer } from "eslint-flat-config-utils";
2
+
3
+ //#region src/base.d.ts
4
+ type Options = {
5
+ tsconfigRootDir: string;
6
+ react?: boolean;
7
+ nextjs?: boolean;
8
+ tailwindEntryPoint?: string;
9
+ vitestGlob?: string;
10
+ playwrightGlob?: string;
11
+ ignores?: string[];
12
+ };
13
+ declare const defineConfig: (options: Options) => FlatConfigComposer;
14
+ //#endregion
15
+ export { defineConfig };
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/base.ts"],"sourcesContent":[],"mappings":";;;KAyBK,OAAA;;EAAA,KAAA,CAAA,EAAA,OAAO;EAaC,MAAA,CAAA,EAAA,OAuDZ;EAAA,kBAAA,CAAA,EAAA,MAAA;YAvDqC,CAAA,EAAA,MAAA;gBAAU,CAAA,EAAA,MAAA;;;cAAnC,wBAAyB,YAAU"}
package/dist/index.js ADDED
@@ -0,0 +1,388 @@
1
+ import { FlatConfigComposer } from "eslint-flat-config-utils";
2
+ import { isPackageExists } from "local-pkg";
3
+ import commentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
4
+ import reactPlugin from "@eslint-react/eslint-plugin";
5
+ import nextPlugin from "@next/eslint-plugin-next";
6
+ import typescriptPlugin from "@typescript-eslint/eslint-plugin";
7
+ import vitestPlugin from "@vitest/eslint-plugin";
8
+ import tailwindcssPlugin from "eslint-plugin-better-tailwindcss";
9
+ import commandPlugin from "eslint-plugin-command/config";
10
+ import deMorganPlugin from "eslint-plugin-de-morgan";
11
+ import importLitePlugin from "eslint-plugin-import-lite";
12
+ import jsdocPlugin from "eslint-plugin-jsdoc";
13
+ import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
14
+ import nodePlugin from "eslint-plugin-n";
15
+ import playwrightPlugin from "eslint-plugin-playwright";
16
+ import prettierPlugin from "eslint-plugin-prettier";
17
+ import prettierPluginRecommended from "eslint-plugin-prettier/recommended";
18
+ import reactHooksPlugin from "eslint-plugin-react-hooks";
19
+ import reactRefreshPlugin from "eslint-plugin-react-refresh";
20
+ import regexpPlugin from "eslint-plugin-regexp";
21
+ import importSortPlugin from "eslint-plugin-simple-import-sort";
22
+ import sonarjsPlugin from "eslint-plugin-sonarjs";
23
+ import unicornPlugin from "eslint-plugin-unicorn";
24
+ import unusedImportsPlugin from "eslint-plugin-unused-imports";
25
+ import gitignorePlugin from "eslint-config-flat-gitignore";
26
+ import eslint from "@eslint/js";
27
+ import globals from "globals";
28
+ import parser from "@typescript-eslint/parser";
29
+
30
+ //#region src/configs/command.ts
31
+ const command = [{
32
+ ...commandPlugin(),
33
+ name: "nelsonlaidev/command/rules"
34
+ }];
35
+
36
+ //#endregion
37
+ //#region src/configs/comments.ts
38
+ const comments = [{
39
+ name: "nelsonlaidev/eslint-comments/rules",
40
+ plugins: { "@eslint-community/eslint-comments": commentsPlugin },
41
+ rules: {
42
+ ...commentsPlugin.configs.recommended.rules,
43
+ "eslint-comments/require-description": "error",
44
+ "eslint-comments/no-unused-disable": "error",
45
+ "eslint-comments/no-restricted-disable": "error",
46
+ "eslint-comments/no-use": "error"
47
+ }
48
+ }];
49
+
50
+ //#endregion
51
+ //#region src/configs/de-morgan.ts
52
+ const deMorgan = [{
53
+ name: "nelsonlaidev/de-morgan/rules",
54
+ plugins: { "de-morgan": deMorganPlugin },
55
+ rules: { ...deMorganPlugin.configs.recommended.rules }
56
+ }];
57
+
58
+ //#endregion
59
+ //#region src/configs/gitignore.ts
60
+ const gitignore = [gitignorePlugin({ name: "nelsonlaidev/gitignore" })];
61
+
62
+ //#endregion
63
+ //#region src/configs/ignores.ts
64
+ const ignores = (userIgnores = []) => [{
65
+ name: "nelsonlaidev/ignores",
66
+ ignores: [...userIgnores]
67
+ }];
68
+
69
+ //#endregion
70
+ //#region src/configs/import-sort.ts
71
+ const importSort = [{
72
+ name: "nelsonlaidev/import-sort/rules",
73
+ plugins: { "import-sort": importSortPlugin },
74
+ rules: {
75
+ "import-sort/imports": ["error", { groups: [
76
+ [
77
+ String.raw`^.*\u0000$`,
78
+ String.raw`^node:.*\u0000$`,
79
+ String.raw`^@?\w.*\u0000$`,
80
+ String.raw`^\.\..*\u0000$`,
81
+ String.raw`^\..*\u0000$`
82
+ ],
83
+ [String.raw`^\u0000`],
84
+ ["^node:"],
85
+ [String.raw`^@?\w`],
86
+ ["^[^.]"],
87
+ [String.raw`^\.\.`],
88
+ [String.raw`^\.`]
89
+ ] }],
90
+ "import-sort/exports": "error"
91
+ }
92
+ }];
93
+
94
+ //#endregion
95
+ //#region src/configs/imports.ts
96
+ const imports = [{
97
+ name: "nelsonlaidev/imports/rules",
98
+ plugins: { import: importLitePlugin },
99
+ rules: {
100
+ "import/consistent-type-specifier-style": ["error", "top-level"],
101
+ "import/first": "error",
102
+ "import/newline-after-import": ["error", { count: 1 }],
103
+ "import/no-duplicates": "error",
104
+ "import/no-mutable-exports": "error",
105
+ "import/no-named-default": "error"
106
+ }
107
+ }];
108
+
109
+ //#endregion
110
+ //#region src/configs/javascript.ts
111
+ const javascript = [{
112
+ name: "nelsonlaidev/javascript/setup",
113
+ languageOptions: {
114
+ ecmaVersion: 2022,
115
+ globals: {
116
+ ...globals.browser,
117
+ ...globals.es2021,
118
+ ...globals.node,
119
+ document: "readonly",
120
+ navigator: "readonly",
121
+ window: "readonly"
122
+ },
123
+ parserOptions: {
124
+ ecmaFeatures: { jsx: true },
125
+ ecmaVersion: 2022,
126
+ sourceType: "module"
127
+ },
128
+ sourceType: "module"
129
+ },
130
+ linterOptions: {
131
+ reportUnusedDisableDirectives: "error",
132
+ reportUnusedInlineConfigs: "error"
133
+ }
134
+ }, {
135
+ name: "nelsonlaidev/javascript/rules",
136
+ plugins: { "unused-imports": unusedImportsPlugin },
137
+ rules: {
138
+ ...eslint.configs.recommended.rules,
139
+ "no-unused-vars": "off",
140
+ "@typescript-eslint/no-unused-vars": "off",
141
+ "unused-imports/no-unused-imports": "error",
142
+ "unused-imports/no-unused-vars": ["error", {
143
+ vars: "all",
144
+ varsIgnorePattern: "^_",
145
+ args: "after-used",
146
+ argsIgnorePattern: "^_"
147
+ }]
148
+ }
149
+ }];
150
+
151
+ //#endregion
152
+ //#region src/configs/jsdoc.ts
153
+ const jsdoc = [{
154
+ name: "nelsonlaidev/jsdoc/rules",
155
+ plugins: { jsdoc: jsdocPlugin },
156
+ rules: { ...jsdocPlugin.configs["flat/recommended"].rules }
157
+ }];
158
+
159
+ //#endregion
160
+ //#region src/globs.ts
161
+ const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
162
+ const GLOB_JSX = "**/*.?([cm])jsx";
163
+ const GLOB_TS = "**/*.?([cm])ts";
164
+ const GLOB_TSX = "**/*.?([cm])tsx";
165
+
166
+ //#endregion
167
+ //#region src/configs/jsx.ts
168
+ const jsx = [{
169
+ name: "nelsonlaidev/jsx/setup",
170
+ files: [GLOB_JSX, GLOB_TSX],
171
+ languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } }
172
+ }, {
173
+ name: "nelsonlaidev/jsx/rules",
174
+ files: [GLOB_JSX, GLOB_TSX],
175
+ plugins: { "jsx-a11y": jsxA11yPlugin },
176
+ rules: {
177
+ ...jsxA11yPlugin.flatConfigs.strict.rules,
178
+ "jsx-a11y/anchor-ambiguous-text": "error",
179
+ "jsx-a11y/lang": "error",
180
+ "jsx-a11y/no-aria-hidden-on-focusable": "error",
181
+ "jsx-a11y/prefer-tag-over-role": "error"
182
+ },
183
+ settings: { "jsx-a11y": { components: {
184
+ Button: "button",
185
+ Image: "img",
186
+ Input: "input",
187
+ Textarea: "textarea",
188
+ Link: "a"
189
+ } } }
190
+ }];
191
+
192
+ //#endregion
193
+ //#region src/configs/nextjs.ts
194
+ const nextjs = [{
195
+ name: "nelsonlaidev/nextjs/rules",
196
+ plugins: { next: nextPlugin },
197
+ rules: {
198
+ ...nextPlugin.configs.recommended.rules,
199
+ ...nextPlugin.configs["core-web-vitals"].rules
200
+ }
201
+ }];
202
+
203
+ //#endregion
204
+ //#region src/configs/node.ts
205
+ const node = [{
206
+ name: "nelsonlaidev/node/rules",
207
+ plugins: { n: nodePlugin },
208
+ rules: {
209
+ ...nodePlugin.configs["flat/recommended-module"].rules,
210
+ "node/no-missing-import": "off",
211
+ "node/no-missing-require": "off",
212
+ "node/no-unpublished-bin": "off",
213
+ "node/no-unpublished-import": "off",
214
+ "node/no-unpublished-require": "off",
215
+ "node/no-unsupported-features/es-builtins": "off",
216
+ "node/no-unsupported-features/es-syntax": "off",
217
+ "node/no-unsupported-features/node-builtins": "off"
218
+ }
219
+ }];
220
+
221
+ //#endregion
222
+ //#region src/configs/playwright.ts
223
+ const playwright = (glob) => [{
224
+ name: "nelsonlaidev/playwright/setup",
225
+ languageOptions: { globals: globals["shared-node-browser"] }
226
+ }, {
227
+ name: "nelsonlaidev/playwright/rules",
228
+ files: [glob],
229
+ plugins: { playwright: playwrightPlugin },
230
+ rules: { ...playwrightPlugin.configs.recommended.rules }
231
+ }];
232
+
233
+ //#endregion
234
+ //#region src/configs/prettier.ts
235
+ const prettier = [{
236
+ name: "nelsonlaidev/prettier/rules",
237
+ plugins: { prettier: prettierPlugin },
238
+ rules: { ...prettierPluginRecommended.rules }
239
+ }];
240
+
241
+ //#endregion
242
+ //#region src/configs/react.ts
243
+ const react = [{
244
+ name: "nelsonlaidev/react/rules",
245
+ files: [GLOB_SRC],
246
+ plugins: {
247
+ ...reactPlugin.configs.all.plugins,
248
+ "react-hooks": reactHooksPlugin,
249
+ "react-refresh": reactRefreshPlugin
250
+ },
251
+ rules: {
252
+ ...reactPlugin.configs.all.rules,
253
+ ...reactHooksPlugin.configs["recommended-latest"].rules,
254
+ ...reactRefreshPlugin.configs.recommended.rules
255
+ }
256
+ }];
257
+
258
+ //#endregion
259
+ //#region src/configs/regexp.ts
260
+ const regexp = [{
261
+ name: "nelsonlaidev/regexp/rules",
262
+ plugins: { regexp: regexpPlugin },
263
+ rules: { ...regexpPlugin.configs["flat/recommended"].rules }
264
+ }];
265
+
266
+ //#endregion
267
+ //#region src/configs/sonarjs.ts
268
+ const sonarjs = [{
269
+ name: "nelsonlaidev/sonarjs/rules",
270
+ plugins: { sonarjs: sonarjsPlugin },
271
+ rules: {
272
+ ...sonarjsPlugin.configs.recommended.rules,
273
+ "sonarjs/no-commented-code": "off"
274
+ }
275
+ }];
276
+
277
+ //#endregion
278
+ //#region src/configs/tailwindcss.ts
279
+ const tailwindcss = (entryPoint) => [{
280
+ name: "nelsonlaidev/tailwindcss/rules",
281
+ plugins: { tailwindcss: tailwindcssPlugin },
282
+ rules: {
283
+ ...tailwindcssPlugin.configs["recommended-error"].rules,
284
+ "tailwindcss/enforce-consistent-variable-syntax": "error",
285
+ "tailwindcss/no-deprecated-classes": "error",
286
+ "tailwindcss/no-restricted-classes": "error",
287
+ "tailwindcss/enforce-shorthand-classes": "error",
288
+ "tailwindcss/enforce-consistent-important-position": "error"
289
+ },
290
+ settings: { tailwindcss: { entryPoint } }
291
+ }];
292
+
293
+ //#endregion
294
+ //#region src/configs/typescript.ts
295
+ const typescript = (tsconfigRootDir) => [{
296
+ name: "nelsonlaidev/typescript/setup",
297
+ files: [GLOB_TS, GLOB_TSX],
298
+ languageOptions: {
299
+ parser,
300
+ parserOptions: {
301
+ projectService: true,
302
+ tsconfigRootDir
303
+ },
304
+ sourceType: "module"
305
+ },
306
+ plugins: { "@typescript-eslint": typescriptPlugin }
307
+ }, {
308
+ name: "nelsonlaidev/typescript/rules",
309
+ files: [GLOB_TS, GLOB_TSX],
310
+ rules: {
311
+ ...typescriptPlugin.configs["eslint-recommended"].overrides[0].rules,
312
+ ...typescriptPlugin.configs["strict-type-checked"].rules,
313
+ ...typescriptPlugin.configs["stylistic-type-checked"].rules,
314
+ "@typescript-eslint/array-type": ["error", { default: "array-simple" }],
315
+ "@typescript-eslint/no-invalid-this": "error",
316
+ "@typescript-eslint/no-shadow": "error",
317
+ "@typescript-eslint/consistent-type-imports": ["error", {
318
+ prefer: "type-imports",
319
+ fixStyle: "inline-type-imports"
320
+ }],
321
+ "@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }],
322
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"]
323
+ }
324
+ }];
325
+
326
+ //#endregion
327
+ //#region src/configs/unicorn.ts
328
+ const unicorn = [{
329
+ name: "nelsonlaidev/unicorn/rules",
330
+ plugins: { unicorn: unicornPlugin },
331
+ rules: {
332
+ ...unicornPlugin.configs.recommended.rules,
333
+ "unicorn/prevent-abbreviations": "off"
334
+ }
335
+ }];
336
+
337
+ //#endregion
338
+ //#region src/configs/vitest.ts
339
+ const vitest = (glob) => [{
340
+ name: "nelsonlaidev/vitest/rules",
341
+ files: [glob],
342
+ plugins: { vitest: vitestPlugin },
343
+ rules: { ...vitestPlugin.configs.recommended.rules }
344
+ }];
345
+
346
+ //#endregion
347
+ //#region src/base.ts
348
+ const isReactInstalled = isPackageExists("react");
349
+ const isNextjsInstalled = isPackageExists("next");
350
+ const defineConfig = (options) => {
351
+ const configs = [
352
+ ...gitignore,
353
+ ...ignores(options.ignores),
354
+ ...javascript,
355
+ ...sonarjs,
356
+ ...importSort,
357
+ ...deMorgan,
358
+ ...comments,
359
+ ...node,
360
+ ...jsdoc,
361
+ ...imports,
362
+ ...command,
363
+ ...unicorn,
364
+ ...jsx,
365
+ ...typescript(options.tsconfigRootDir),
366
+ ...regexp
367
+ ];
368
+ if (options.vitestGlob) configs.push(...vitest(options.vitestGlob));
369
+ if (options.playwrightGlob) configs.push(...playwright(options.playwrightGlob));
370
+ if (options.react ?? isReactInstalled) configs.push(...react);
371
+ if (options.nextjs ?? isNextjsInstalled) configs.push(...nextjs);
372
+ if (options.tailwindEntryPoint) configs.push(...tailwindcss(options.tailwindEntryPoint));
373
+ configs.push(...prettier);
374
+ let composer = new FlatConfigComposer();
375
+ composer = composer.append(configs);
376
+ composer = composer.renamePlugins({
377
+ n: "node",
378
+ "import-lite": "import",
379
+ "better-tailwindcss": "tailwindcss",
380
+ "@eslint-community/eslint-comments": "eslint-comments",
381
+ "@next/next": "next"
382
+ });
383
+ return composer;
384
+ };
385
+
386
+ //#endregion
387
+ export { defineConfig };
388
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["command: Linter.Config[]","comments: Linter.Config[]","deMorgan: Linter.Config[]","gitignore: Linter.Config[]","importSort: Linter.Config[]","imports: Linter.Config[]","javascript: Linter.Config[]","jsdoc: Linter.Config[]","jsx: Linter.Config[]","nextjs: Linter.Config[]","node: Linter.Config[]","prettier: Linter.Config[]","react: Linter.Config[]","regexp: Linter.Config[]","sonarjs: Linter.Config[]","unicorn: Linter.Config[]"],"sources":["../src/configs/command.ts","../src/configs/comments.ts","../src/configs/de-morgan.ts","../src/configs/gitignore.ts","../src/configs/ignores.ts","../src/configs/import-sort.ts","../src/configs/imports.ts","../src/configs/javascript.ts","../src/configs/jsdoc.ts","../src/globs.ts","../src/configs/jsx.ts","../src/configs/nextjs.ts","../src/configs/node.ts","../src/configs/playwright.ts","../src/configs/prettier.ts","../src/configs/react.ts","../src/configs/regexp.ts","../src/configs/sonarjs.ts","../src/configs/tailwindcss.ts","../src/configs/typescript.ts","../src/configs/unicorn.ts","../src/configs/vitest.ts","../src/base.ts"],"sourcesContent":["import type { Linter } from 'eslint'\n\nimport { commandPlugin } from '../plugins'\n\nexport const command: Linter.Config[] = [\n {\n ...commandPlugin(),\n name: 'nelsonlaidev/command/rules'\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { commentsPlugin } from '../plugins'\n\nexport const comments: Linter.Config[] = [\n {\n name: 'nelsonlaidev/eslint-comments/rules',\n plugins: {\n '@eslint-community/eslint-comments': commentsPlugin\n },\n rules: {\n ...commentsPlugin.configs.recommended.rules,\n\n 'eslint-comments/require-description': 'error',\n 'eslint-comments/no-unused-disable': 'error',\n 'eslint-comments/no-restricted-disable': 'error',\n 'eslint-comments/no-use': 'error'\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { deMorganPlugin } from '../plugins'\n\nexport const deMorgan: Linter.Config[] = [\n {\n name: 'nelsonlaidev/de-morgan/rules',\n plugins: {\n 'de-morgan': deMorganPlugin\n },\n rules: {\n ...deMorganPlugin.configs.recommended.rules\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport gitignorePlugin from 'eslint-config-flat-gitignore'\n\nexport const gitignore: Linter.Config[] = [\n gitignorePlugin({\n name: 'nelsonlaidev/gitignore'\n })\n]\n","import type { Linter } from 'eslint'\n\nexport const ignores = (userIgnores: string[] = []): Linter.Config[] => [\n {\n name: 'nelsonlaidev/ignores',\n ignores: [...userIgnores]\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { importSortPlugin } from '../plugins'\n\nexport const importSort: Linter.Config[] = [\n {\n name: 'nelsonlaidev/import-sort/rules',\n plugins: {\n 'import-sort': importSortPlugin\n },\n rules: {\n 'import-sort/imports': [\n 'error',\n {\n groups: [\n // Type imports\n [\n String.raw`^.*\\u0000$`,\n String.raw`^node:.*\\u0000$`,\n String.raw`^@?\\w.*\\u0000$`,\n String.raw`^\\.\\..*\\u0000$`,\n String.raw`^\\..*\\u0000$`\n ],\n\n // Side effect imports (e.g., `import 'some-module'`)\n [String.raw`^\\u0000`],\n\n // Node.js builtins prefixed with `node:`\n ['^node:'],\n\n // Things that start with a letter (or digit or underscore), or `@` followed by a letter\n [String.raw`^@?\\w`],\n\n // Absolute imports (e.g., `import something from 'src/utils'`)\n ['^[^.]'],\n\n // Parent directory relative imports (e.g., `import something from '../utils'`)\n [String.raw`^\\.\\.`],\n\n // Current directory relative imports (e.g., `import something from './utils'`)\n [String.raw`^\\.`]\n ]\n }\n ],\n 'import-sort/exports': 'error'\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { importLitePlugin } from '../plugins'\n\nexport const imports: Linter.Config[] = [\n {\n name: 'nelsonlaidev/imports/rules',\n plugins: {\n import: importLitePlugin\n },\n rules: {\n 'import/consistent-type-specifier-style': ['error', 'top-level'],\n 'import/first': 'error',\n 'import/newline-after-import': ['error', { count: 1 }],\n 'import/no-duplicates': 'error',\n 'import/no-mutable-exports': 'error',\n 'import/no-named-default': 'error'\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport eslint from '@eslint/js'\nimport globals from 'globals'\n\nimport { unusedImportsPlugin } from '../plugins'\n\nexport const javascript: Linter.Config[] = [\n {\n name: 'nelsonlaidev/javascript/setup',\n languageOptions: {\n ecmaVersion: 2022,\n globals: {\n ...globals.browser,\n ...globals.es2021,\n ...globals.node,\n document: 'readonly',\n navigator: 'readonly',\n window: 'readonly'\n },\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n },\n ecmaVersion: 2022,\n sourceType: 'module'\n },\n sourceType: 'module'\n },\n linterOptions: {\n reportUnusedDisableDirectives: 'error',\n reportUnusedInlineConfigs: 'error'\n }\n },\n {\n name: 'nelsonlaidev/javascript/rules',\n plugins: {\n 'unused-imports': unusedImportsPlugin\n },\n rules: {\n ...eslint.configs.recommended.rules,\n\n // Recommended to disable\n // https://github.com/sweepline/eslint-plugin-unused-imports?tab=readme-ov-file#usage\n 'no-unused-vars': 'off',\n '@typescript-eslint/no-unused-vars': 'off',\n\n 'unused-imports/no-unused-imports': 'error',\n 'unused-imports/no-unused-vars': [\n 'error',\n {\n vars: 'all',\n varsIgnorePattern: '^_',\n args: 'after-used',\n argsIgnorePattern: '^_'\n }\n ]\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { jsdocPlugin } from '../plugins'\n\nexport const jsdoc: Linter.Config[] = [\n {\n name: 'nelsonlaidev/jsdoc/rules',\n plugins: {\n jsdoc: jsdocPlugin\n },\n rules: {\n ...jsdocPlugin.configs['flat/recommended'].rules\n }\n }\n]\n","export const GLOB_SRC_EXT = '?([cm])[jt]s?(x)'\nexport const GLOB_SRC = '**/*.?([cm])[jt]s?(x)'\n\nexport const GLOB_JS = '**/*.?([cm])js'\nexport const GLOB_JSX = '**/*.?([cm])jsx'\n\nexport const GLOB_TS = '**/*.?([cm])ts'\nexport const GLOB_TSX = '**/*.?([cm])tsx'\n","import type { Linter } from 'eslint'\n\nimport { GLOB_JSX, GLOB_TSX } from '../globs'\nimport { jsxA11yPlugin } from '../plugins'\n\nexport const jsx: Linter.Config[] = [\n {\n name: 'nelsonlaidev/jsx/setup',\n files: [GLOB_JSX, GLOB_TSX],\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n }\n }\n }\n },\n {\n name: 'nelsonlaidev/jsx/rules',\n files: [GLOB_JSX, GLOB_TSX],\n plugins: {\n 'jsx-a11y': jsxA11yPlugin\n },\n rules: {\n ...jsxA11yPlugin.flatConfigs.strict.rules,\n\n 'jsx-a11y/anchor-ambiguous-text': 'error',\n 'jsx-a11y/lang': 'error',\n 'jsx-a11y/no-aria-hidden-on-focusable': 'error',\n 'jsx-a11y/prefer-tag-over-role': 'error'\n },\n settings: {\n 'jsx-a11y': {\n components: {\n Button: 'button',\n Image: 'img',\n Input: 'input',\n Textarea: 'textarea',\n Link: 'a'\n }\n }\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { nextPlugin } from '../plugins'\n\nexport const nextjs: Linter.Config[] = [\n {\n name: 'nelsonlaidev/nextjs/rules',\n plugins: {\n next: nextPlugin\n },\n rules: {\n ...nextPlugin.configs.recommended.rules,\n ...nextPlugin.configs['core-web-vitals'].rules\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { nodePlugin } from '../plugins'\n\nexport const node: Linter.Config[] = [\n {\n name: 'nelsonlaidev/node/rules',\n plugins: {\n n: nodePlugin\n },\n rules: {\n ...nodePlugin.configs['flat/recommended-module'].rules,\n\n // Handled by TypeScript\n 'node/no-missing-import': 'off',\n 'node/no-missing-require': 'off',\n 'node/no-unpublished-bin': 'off',\n 'node/no-unpublished-import': 'off',\n 'node/no-unpublished-require': 'off',\n 'node/no-unsupported-features/es-builtins': 'off',\n 'node/no-unsupported-features/es-syntax': 'off',\n 'node/no-unsupported-features/node-builtins': 'off'\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport globals from 'globals'\n\nimport { playwrightPlugin } from '../plugins'\n\nexport const playwright = (glob: string): Linter.Config[] => [\n {\n name: 'nelsonlaidev/playwright/setup',\n languageOptions: {\n globals: globals['shared-node-browser']\n }\n },\n {\n name: 'nelsonlaidev/playwright/rules',\n files: [glob],\n plugins: {\n playwright: playwrightPlugin\n },\n rules: {\n ...playwrightPlugin.configs.recommended.rules\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { prettierPlugin, prettierPluginRecommended } from '../plugins'\n\nexport const prettier: Linter.Config[] = [\n {\n name: 'nelsonlaidev/prettier/rules',\n plugins: {\n prettier: prettierPlugin\n },\n rules: {\n ...prettierPluginRecommended.rules\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { GLOB_SRC } from '../globs'\nimport { reactHooksPlugin, reactPlugin, reactRefreshPlugin } from '../plugins'\n\nexport const react: Linter.Config[] = [\n {\n name: 'nelsonlaidev/react/rules',\n files: [GLOB_SRC],\n plugins: {\n ...reactPlugin.configs.all.plugins,\n 'react-hooks': reactHooksPlugin,\n 'react-refresh': reactRefreshPlugin\n },\n rules: {\n ...reactPlugin.configs.all.rules,\n ...reactHooksPlugin.configs['recommended-latest'].rules,\n ...reactRefreshPlugin.configs.recommended.rules\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { regexpPlugin } from '../plugins'\n\nexport const regexp: Linter.Config[] = [\n {\n name: 'nelsonlaidev/regexp/rules',\n plugins: {\n regexp: regexpPlugin\n },\n rules: {\n ...regexpPlugin.configs['flat/recommended'].rules\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { sonarjsPlugin } from '../plugins'\n\nexport const sonarjs: Linter.Config[] = [\n {\n name: 'nelsonlaidev/sonarjs/rules',\n plugins: {\n sonarjs: sonarjsPlugin\n },\n rules: {\n ...sonarjsPlugin.configs.recommended.rules,\n\n // Disable due to poor performance\n // https://community.sonarsource.com/t/eslint-plugin-sonarjs-performance-issues-on-large-codebase/138392\n 'sonarjs/no-commented-code': 'off'\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { tailwindcssPlugin } from '../plugins'\n\nexport const tailwindcss = (entryPoint: string): Linter.Config[] => [\n {\n name: 'nelsonlaidev/tailwindcss/rules',\n plugins: {\n tailwindcss: tailwindcssPlugin\n },\n rules: {\n ...tailwindcssPlugin.configs['recommended-error'].rules,\n\n 'tailwindcss/enforce-consistent-variable-syntax': 'error',\n 'tailwindcss/no-deprecated-classes': 'error',\n 'tailwindcss/no-restricted-classes': 'error',\n 'tailwindcss/enforce-shorthand-classes': 'error',\n 'tailwindcss/enforce-consistent-important-position': 'error'\n },\n settings: {\n tailwindcss: {\n entryPoint\n }\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport parser from '@typescript-eslint/parser'\n\nimport { GLOB_TS, GLOB_TSX } from '../globs'\nimport { typescriptPlugin } from '../plugins'\n\nexport const typescript = (tsconfigRootDir: string): Linter.Config[] => [\n {\n name: 'nelsonlaidev/typescript/setup',\n files: [GLOB_TS, GLOB_TSX],\n languageOptions: {\n parser,\n parserOptions: {\n projectService: true,\n tsconfigRootDir\n },\n sourceType: 'module'\n },\n plugins: {\n '@typescript-eslint': typescriptPlugin\n }\n },\n {\n name: 'nelsonlaidev/typescript/rules',\n files: [GLOB_TS, GLOB_TSX],\n rules: {\n ...typescriptPlugin.configs['eslint-recommended'].overrides[0].rules,\n ...typescriptPlugin.configs['strict-type-checked'].rules,\n ...typescriptPlugin.configs['stylistic-type-checked'].rules,\n\n '@typescript-eslint/array-type': ['error', { default: 'array-simple' }],\n '@typescript-eslint/no-invalid-this': 'error',\n '@typescript-eslint/no-shadow': 'error',\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n fixStyle: 'inline-type-imports'\n }\n ],\n '@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],\n '@typescript-eslint/consistent-type-definitions': ['error', 'type']\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { unicornPlugin } from '../plugins'\n\nexport const unicorn: Linter.Config[] = [\n {\n name: 'nelsonlaidev/unicorn/rules',\n plugins: {\n unicorn: unicornPlugin\n },\n rules: {\n ...unicornPlugin.configs.recommended.rules,\n\n 'unicorn/prevent-abbreviations': 'off'\n }\n }\n]\n","import type { Linter } from 'eslint'\n\nimport { vitestPlugin } from '../plugins'\n\nexport const vitest = (glob: string): Linter.Config[] => [\n {\n name: 'nelsonlaidev/vitest/rules',\n files: [glob],\n plugins: {\n vitest: vitestPlugin\n },\n rules: {\n ...vitestPlugin.configs.recommended.rules\n }\n }\n]\n","import { FlatConfigComposer } from 'eslint-flat-config-utils'\nimport { isPackageExists } from 'local-pkg'\n\nimport { command } from './configs/command'\nimport { comments } from './configs/comments'\nimport { deMorgan } from './configs/de-morgan'\nimport { gitignore } from './configs/gitignore'\nimport { ignores } from './configs/ignores'\nimport { importSort } from './configs/import-sort'\nimport { imports } from './configs/imports'\nimport { javascript } from './configs/javascript'\nimport { jsdoc } from './configs/jsdoc'\nimport { jsx } from './configs/jsx'\nimport { nextjs } from './configs/nextjs'\nimport { node } from './configs/node'\nimport { playwright } from './configs/playwright'\nimport { prettier } from './configs/prettier'\nimport { react } from './configs/react'\nimport { regexp } from './configs/regexp'\nimport { sonarjs } from './configs/sonarjs'\nimport { tailwindcss } from './configs/tailwindcss'\nimport { typescript } from './configs/typescript'\nimport { unicorn } from './configs/unicorn'\nimport { vitest } from './configs/vitest'\n\ntype Options = {\n tsconfigRootDir: string\n react?: boolean\n nextjs?: boolean\n tailwindEntryPoint?: string\n vitestGlob?: string\n playwrightGlob?: string\n ignores?: string[]\n}\n\nconst isReactInstalled = isPackageExists('react')\nconst isNextjsInstalled = isPackageExists('next')\n\nexport const defineConfig = (options: Options): FlatConfigComposer => {\n const configs = [\n ...gitignore,\n ...ignores(options.ignores),\n ...javascript,\n ...sonarjs,\n ...importSort,\n ...deMorgan,\n ...comments,\n ...node,\n ...jsdoc,\n ...imports,\n ...command,\n ...unicorn,\n ...jsx,\n ...typescript(options.tsconfigRootDir),\n ...regexp\n ]\n\n if (options.vitestGlob) {\n configs.push(...vitest(options.vitestGlob))\n }\n\n if (options.playwrightGlob) {\n configs.push(...playwright(options.playwrightGlob))\n }\n\n if (options.react ?? isReactInstalled) {\n configs.push(...react)\n }\n\n if (options.nextjs ?? isNextjsInstalled) {\n configs.push(...nextjs)\n }\n\n if (options.tailwindEntryPoint) {\n configs.push(...tailwindcss(options.tailwindEntryPoint))\n }\n\n // Must be added as the last item\n // https://github.com/prettier/eslint-plugin-prettier?tab=readme-ov-file#configuration-new-eslintconfigjs\n configs.push(...prettier)\n\n let composer = new FlatConfigComposer()\n\n composer = composer.append(configs)\n composer = composer.renamePlugins({\n n: 'node',\n 'import-lite': 'import',\n 'better-tailwindcss': 'tailwindcss',\n '@eslint-community/eslint-comments': 'eslint-comments',\n '@next/next': 'next'\n })\n\n return composer\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAaA,UAA2B,CACtC;CACE,GAAG;CACH,MAAM;;;;;ACHV,MAAaC,WAA4B,CACvC;CACE,MAAM;CACN,SAAS,EACP,qCAAqC;CAEvC,OAAO;EACL,GAAG,eAAe,QAAQ,YAAY;EAEtC,uCAAuC;EACvC,qCAAqC;EACrC,yCAAyC;EACzC,0BAA0B;;;;;;ACZhC,MAAaC,WAA4B,CACvC;CACE,MAAM;CACN,SAAS,EACP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,EACP,SAAS;CAEX,OAAO;EACL,GAAG,cAAc,QAAQ,YAAY;EAErC,iCAAiC;;;;;;ACTvC,MAAa,UAAU,SAAkC,CACvD;CACE,MAAM;CACN,OAAO,CAAC;CACR,SAAS,EACP,QAAQ;CAEV,OAAO,EACL,GAAG,aAAa,QAAQ,YAAY;;;;;ACuB1C,MAAM,mBAAmB,gBAAgB;AACzC,MAAM,oBAAoB,gBAAgB;AAE1C,MAAa,gBAAgB,YAAyC;CACpE,MAAM,UAAU;EACd,GAAG;EACH,GAAG,QAAQ,QAAQ;EACnB,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG,WAAW,QAAQ;EACtB,GAAG;;AAGL,KAAI,QAAQ,WACV,SAAQ,KAAK,GAAG,OAAO,QAAQ;AAGjC,KAAI,QAAQ,eACV,SAAQ,KAAK,GAAG,WAAW,QAAQ;AAGrC,KAAI,QAAQ,SAAS,iBACnB,SAAQ,KAAK,GAAG;AAGlB,KAAI,QAAQ,UAAU,kBACpB,SAAQ,KAAK,GAAG;AAGlB,KAAI,QAAQ,mBACV,SAAQ,KAAK,GAAG,YAAY,QAAQ;AAKtC,SAAQ,KAAK,GAAG;CAEhB,IAAI,WAAW,IAAI;AAEnB,YAAW,SAAS,OAAO;AAC3B,YAAW,SAAS,cAAc;EAChC,GAAG;EACH,eAAe;EACf,sBAAsB;EACtB,qCAAqC;EACrC,cAAc;;AAGhB,QAAO"}
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@nelsonlaidev/eslint-config",
3
+ "version": "0.0.1",
4
+ "homepage": "https://github.com/nelsonlaidev/config/blob/main/packages/eslint-config/README.md",
5
+ "bugs": {
6
+ "url": "https://github.com/nelsonlaidev/config/issues"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/nelsonlaidev/config.git",
11
+ "directory": "packages/eslint-config"
12
+ },
13
+ "license": "MIT",
14
+ "author": "Nelson Lai <me@nelsonlai.me> (https://github.com/nelsonlaidev/)",
15
+ "type": "module",
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "lint-staged": {
22
+ "*.ts": "eslint --fix"
23
+ },
24
+ "dependencies": {
25
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
26
+ "@eslint-react/eslint-plugin": "^1.52.6",
27
+ "@eslint/js": "^9.34.0",
28
+ "@next/eslint-plugin-next": "^15.5.2",
29
+ "@typescript-eslint/eslint-plugin": "^8.41.0",
30
+ "@typescript-eslint/parser": "^8.41.0",
31
+ "@vitest/eslint-plugin": "^1.3.4",
32
+ "eslint-config-flat-gitignore": "^2.1.0",
33
+ "eslint-config-prettier": "^10.1.8",
34
+ "eslint-flat-config-utils": "^2.1.1",
35
+ "eslint-plugin-better-tailwindcss": "^3.7.6",
36
+ "eslint-plugin-command": "^3.3.1",
37
+ "eslint-plugin-de-morgan": "^1.3.1",
38
+ "eslint-plugin-import-lite": "^0.3.0",
39
+ "eslint-plugin-jsdoc": "^54.1.1",
40
+ "eslint-plugin-jsx-a11y": "^6.10.2",
41
+ "eslint-plugin-n": "^17.21.3",
42
+ "eslint-plugin-playwright": "^2.2.2",
43
+ "eslint-plugin-prettier": "^5.5.4",
44
+ "eslint-plugin-react-hooks": "^5.2.0",
45
+ "eslint-plugin-react-refresh": "^0.4.20",
46
+ "eslint-plugin-regexp": "^2.10.0",
47
+ "eslint-plugin-simple-import-sort": "^12.1.1",
48
+ "eslint-plugin-sonarjs": "^3.0.5",
49
+ "eslint-plugin-unicorn": "^60.0.0",
50
+ "eslint-plugin-unused-imports": "^4.2.0",
51
+ "globals": "^16.3.0",
52
+ "local-pkg": "^1.1.2"
53
+ },
54
+ "devDependencies": {
55
+ "@eslint/config-inspector": "^1.2.0",
56
+ "@types/node": "^22.18.0",
57
+ "eslint": "^9.34.0",
58
+ "tsdown": "^0.14.2",
59
+ "@nelsonlaidev/typescript-config": "0.0.1"
60
+ },
61
+ "peerDependencies": {
62
+ "eslint": ">=9.0.0"
63
+ },
64
+ "publishConfig": {
65
+ "access": "public"
66
+ },
67
+ "scripts": {
68
+ "build": "tsdown",
69
+ "build:inspector": "eslint-config-inspector build --config ./eslint-inspector.config.ts",
70
+ "clean": "rm -rf .turbo dist .eslint-config-inspector",
71
+ "dev": "tsdown --watch",
72
+ "dev:inspector": "eslint-config-inspector --config eslint-inspector.config.ts",
73
+ "lint": "eslint . --max-warnings 0",
74
+ "lint:fix": "eslint --fix .",
75
+ "type-check": "tsc --noEmit"
76
+ }
77
+ }