@kasoa/eslint-config 0.0.2
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 +21 -0
- package/README.md +86 -0
- package/dist/base/eslint.d.ts +2 -0
- package/dist/base/eslint.d.ts.map +1 -0
- package/dist/base/eslint.js +3 -0
- package/dist/base/import-lite.d.ts +2 -0
- package/dist/base/import-lite.d.ts.map +1 -0
- package/dist/base/import-lite.js +8 -0
- package/dist/base/index.d.ts +2 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +11 -0
- package/dist/base/perfectionist.d.ts +2 -0
- package/dist/base/perfectionist.d.ts.map +1 -0
- package/dist/base/perfectionist.js +49 -0
- package/dist/base/typescript-eslint.d.ts +2 -0
- package/dist/base/typescript-eslint.d.ts.map +1 -0
- package/dist/base/typescript-eslint.js +8 -0
- package/dist/base/unicorn-x.d.ts +2 -0
- package/dist/base/unicorn-x.d.ts.map +1 -0
- package/dist/base/unicorn-x.js +9 -0
- package/dist/base/unused-imports.d.ts +2 -0
- package/dist/base/unused-imports.d.ts.map +1 -0
- package/dist/base/unused-imports.js +20 -0
- package/dist/base/vitest.d.ts +2 -0
- package/dist/base/vitest.d.ts.map +1 -0
- package/dist/base/vitest.js +6 -0
- package/dist/eslint.config.d.ts +3 -0
- package/dist/eslint.config.d.ts.map +1 -0
- package/dist/eslint.config.js +10 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +4 -0
- package/dist/node/n.d.ts +2 -0
- package/dist/node/n.d.ts.map +1 -0
- package/dist/node/n.js +3 -0
- package/dist/react/eslint-react.d.ts +2 -0
- package/dist/react/eslint-react.d.ts.map +1 -0
- package/dist/react/eslint-react.js +3 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +8 -0
- package/dist/react/jsx-a11y-x.d.ts +2 -0
- package/dist/react/jsx-a11y-x.d.ts.map +1 -0
- package/dist/react/jsx-a11y-x.js +4 -0
- package/dist/react/react-compiler.d.ts +2 -0
- package/dist/react/react-compiler.d.ts.map +1 -0
- package/dist/react/react-compiler.js +3 -0
- package/dist/react/react-hooks.d.ts +2 -0
- package/dist/react/react-hooks.d.ts.map +1 -0
- package/dist/react/react-hooks.js +3 -0
- package/dist/react/react-refresh.d.ts +2 -0
- package/dist/react/react-refresh.d.ts.map +1 -0
- package/dist/react/react-refresh.js +3 -0
- package/dist/src/base/eslint.d.ts +2 -0
- package/dist/src/base/eslint.d.ts.map +1 -0
- package/dist/src/base/eslint.js +3 -0
- package/dist/src/base/import-lite.d.ts +2 -0
- package/dist/src/base/import-lite.d.ts.map +1 -0
- package/dist/src/base/import-lite.js +8 -0
- package/dist/src/base/index.d.ts +2 -0
- package/dist/src/base/index.d.ts.map +1 -0
- package/dist/src/base/index.js +11 -0
- package/dist/src/base/perfectionist.d.ts +2 -0
- package/dist/src/base/perfectionist.d.ts.map +1 -0
- package/dist/src/base/perfectionist.js +49 -0
- package/dist/src/base/typescript-eslint.d.ts +2 -0
- package/dist/src/base/typescript-eslint.d.ts.map +1 -0
- package/dist/src/base/typescript-eslint.js +8 -0
- package/dist/src/base/unicorn-x.d.ts +2 -0
- package/dist/src/base/unicorn-x.d.ts.map +1 -0
- package/dist/src/base/unicorn-x.js +9 -0
- package/dist/src/base/unused-imports.d.ts +2 -0
- package/dist/src/base/unused-imports.d.ts.map +1 -0
- package/dist/src/base/unused-imports.js +20 -0
- package/dist/src/base/vitest.d.ts +2 -0
- package/dist/src/base/vitest.d.ts.map +1 -0
- package/dist/src/base/vitest.js +6 -0
- package/dist/src/node/index.d.ts +2 -0
- package/dist/src/node/index.d.ts.map +1 -0
- package/dist/src/node/index.js +4 -0
- package/dist/src/node/n.d.ts +2 -0
- package/dist/src/node/n.d.ts.map +1 -0
- package/dist/src/node/n.js +3 -0
- package/dist/src/react/eslint-react.d.ts +2 -0
- package/dist/src/react/eslint-react.d.ts.map +1 -0
- package/dist/src/react/eslint-react.js +3 -0
- package/dist/src/react/index.d.ts +2 -0
- package/dist/src/react/index.d.ts.map +1 -0
- package/dist/src/react/index.js +8 -0
- package/dist/src/react/jsx-a11y-x.d.ts +2 -0
- package/dist/src/react/jsx-a11y-x.d.ts.map +1 -0
- package/dist/src/react/jsx-a11y-x.js +4 -0
- package/dist/src/react/react-compiler.d.ts +2 -0
- package/dist/src/react/react-compiler.d.ts.map +1 -0
- package/dist/src/react/react-compiler.js +3 -0
- package/dist/src/react/react-hooks.d.ts +2 -0
- package/dist/src/react/react-hooks.d.ts.map +1 -0
- package/dist/src/react/react-hooks.js +3 -0
- package/dist/src/react/react-refresh.d.ts +2 -0
- package/dist/src/react/react-refresh.d.ts.map +1 -0
- package/dist/src/react/react-refresh.js +3 -0
- package/package.json +76 -0
- package/src/base/eslint.ts +4 -0
- package/src/base/import-lite.ts +12 -0
- package/src/base/index.ts +23 -0
- package/src/base/perfectionist.ts +50 -0
- package/src/base/typescript-eslint.ts +13 -0
- package/src/base/unicorn-x.ts +10 -0
- package/src/base/unused-imports.ts +21 -0
- package/src/base/vitest.ts +13 -0
- package/src/node/index.ts +5 -0
- package/src/node/n.ts +6 -0
- package/src/react/eslint-react.ts +6 -0
- package/src/react/index.ts +16 -0
- package/src/react/jsx-a11y-x.ts +13 -0
- package/src/react/react-compiler.ts +6 -0
- package/src/react/react-hooks.ts +6 -0
- package/src/react/react-refresh.ts +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Emmanuel Chucks
|
|
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,86 @@
|
|
|
1
|
+
# @kasoa/eslint-config
|
|
2
|
+
|
|
3
|
+
Kasoa's ESLint config
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install ESLint and the config:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add -D @kasoa/eslint-config eslint
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Note**: Requires Node.js >=22 and a TypeScript setup.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
Import the desired config in your `eslint.config.ts` (using ESLint's flat config format). Extend it with project-specific overrides as needed.
|
|
18
|
+
|
|
19
|
+
### React Projects
|
|
20
|
+
|
|
21
|
+
For React applications with TypeScript:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import { react } from "@kasoa/eslint-config/react";
|
|
25
|
+
import { defineConfig } from "eslint/config";
|
|
26
|
+
|
|
27
|
+
export default defineConfig(react, {
|
|
28
|
+
languageOptions: {
|
|
29
|
+
parserOptions: {
|
|
30
|
+
tsconfigRootDir: import.meta.dirname,
|
|
31
|
+
projectService: true,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Node.js Projects
|
|
38
|
+
|
|
39
|
+
For Node.js backends or scripts:
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
import { node } from "@kasoa/eslint-config/node";
|
|
43
|
+
import { defineConfig } from "eslint/config";
|
|
44
|
+
|
|
45
|
+
export default defineConfig(node, {
|
|
46
|
+
// Add custom rules or overrides here
|
|
47
|
+
rules: {
|
|
48
|
+
"no-console": "warn",
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Base Config
|
|
54
|
+
|
|
55
|
+
For minimal setups (e.g., libraries or custom extensions):
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
import { base } from "@kasoa/eslint-config/base";
|
|
59
|
+
import { defineConfig } from "eslint/config";
|
|
60
|
+
|
|
61
|
+
export default defineConfig(base, {
|
|
62
|
+
// Customize as needed
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Configurations
|
|
67
|
+
|
|
68
|
+
- **`base`**: Core rules for TypeScript, imports, code quality, and testing.
|
|
69
|
+
- **`node`**: Extends `base` with Node.js-specific rules.
|
|
70
|
+
- **`react`**: Extends `base` with React-specific rules.
|
|
71
|
+
|
|
72
|
+
All configs use Prettier-compatible rules and enforce strict standards.
|
|
73
|
+
|
|
74
|
+
## Contributing
|
|
75
|
+
|
|
76
|
+
- Follow project conventions.
|
|
77
|
+
- Test changes in a sample project.
|
|
78
|
+
- Update this README for new configs.
|
|
79
|
+
|
|
80
|
+
## Author
|
|
81
|
+
|
|
82
|
+
Emmanuel Chucks [https://github.com/emmanuelchucks](https://github.com/emmanuelchucks)
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../../src/base/eslint.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,uEAA2C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-lite.d.ts","sourceRoot":"","sources":["../../src/base/import-lite.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,uEAQ5B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
|
+
import importLite from "eslint-plugin-import-lite";
|
|
3
|
+
export const importLiteConfig = defineConfig(importLite.configs.recommended, {
|
|
4
|
+
rules: {
|
|
5
|
+
"import-lite/consistent-type-specifier-style": ["error", "top-level"],
|
|
6
|
+
"import-lite/newline-after-import": "error",
|
|
7
|
+
},
|
|
8
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,IAAI,uEAWhB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import eslintConfigPrettier from "eslint-config-prettier/flat";
|
|
2
|
+
import gitignore from "eslint-config-flat-gitignore";
|
|
3
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
4
|
+
import { eslintConfig } from "./eslint.js";
|
|
5
|
+
import { typescriptEslintConfig } from "./typescript-eslint.js";
|
|
6
|
+
import { unicornXConfig } from "./unicorn-x.js";
|
|
7
|
+
import { vitestConfig } from "./vitest.js";
|
|
8
|
+
import { unusedImportsConfig } from "./unused-imports.js";
|
|
9
|
+
import { importLiteConfig } from "./import-lite.js";
|
|
10
|
+
import { perfectionistConfig } from "./perfectionist.js";
|
|
11
|
+
export const base = defineConfig(gitignore(), globalIgnores(["**/*.d.ts"]), eslintConfig, typescriptEslintConfig, unicornXConfig, vitestConfig, importLiteConfig, unusedImportsConfig, perfectionistConfig, eslintConfigPrettier);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perfectionist.d.ts","sourceRoot":"","sources":["../../src/base/perfectionist.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,uEA8C9B,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
|
+
import perfectionist from "eslint-plugin-perfectionist";
|
|
3
|
+
export const perfectionistConfig = defineConfig({
|
|
4
|
+
plugins: {
|
|
5
|
+
perfectionist,
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
"perfectionist/sort-exports": [
|
|
9
|
+
"error",
|
|
10
|
+
{
|
|
11
|
+
order: "asc",
|
|
12
|
+
type: "natural",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
"perfectionist/sort-imports": [
|
|
16
|
+
"error",
|
|
17
|
+
{
|
|
18
|
+
groups: [
|
|
19
|
+
"type",
|
|
20
|
+
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
21
|
+
"builtin",
|
|
22
|
+
"external",
|
|
23
|
+
"internal",
|
|
24
|
+
["parent", "sibling", "index"],
|
|
25
|
+
"side-effect",
|
|
26
|
+
"object",
|
|
27
|
+
"unknown",
|
|
28
|
+
],
|
|
29
|
+
newlinesBetween: 0,
|
|
30
|
+
order: "asc",
|
|
31
|
+
type: "natural",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
"perfectionist/sort-named-exports": [
|
|
35
|
+
"error",
|
|
36
|
+
{
|
|
37
|
+
order: "asc",
|
|
38
|
+
type: "natural",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
"perfectionist/sort-named-imports": [
|
|
42
|
+
"error",
|
|
43
|
+
{
|
|
44
|
+
order: "asc",
|
|
45
|
+
type: "natural",
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-eslint.d.ts","sourceRoot":"","sources":["../../src/base/typescript-eslint.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,uEASlC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
|
+
import typescriptEslint from "typescript-eslint";
|
|
3
|
+
export const typescriptEslintConfig = defineConfig(typescriptEslint.configs.strictTypeChecked, typescriptEslint.configs.stylisticTypeChecked, {
|
|
4
|
+
rules: {
|
|
5
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
6
|
+
"@typescript-eslint/explicit-module-boundary-types": "error",
|
|
7
|
+
},
|
|
8
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unicorn-x.d.ts","sourceRoot":"","sources":["../../src/base/unicorn-x.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,uEAMzB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
|
+
import unicornX from "eslint-plugin-unicorn-x";
|
|
3
|
+
export const unicornXConfig = defineConfig(unicornX.configs.recommended, {
|
|
4
|
+
rules: {
|
|
5
|
+
"unicorn-x/prevent-abbreviations": "off",
|
|
6
|
+
"unicorn-x/better-regex": "error",
|
|
7
|
+
"unicorn-x/prefer-import-meta-properties": "error",
|
|
8
|
+
},
|
|
9
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unused-imports.d.ts","sourceRoot":"","sources":["../../src/base/unused-imports.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,uEAiB9B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
|
+
import unusedImports from "eslint-plugin-unused-imports";
|
|
3
|
+
export const unusedImportsConfig = defineConfig({
|
|
4
|
+
rules: {
|
|
5
|
+
"unused-imports/no-unused-vars": [
|
|
6
|
+
"warn",
|
|
7
|
+
{
|
|
8
|
+
varsIgnorePattern: "^_",
|
|
9
|
+
argsIgnorePattern: "^_",
|
|
10
|
+
args: "after-used",
|
|
11
|
+
vars: "all",
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
"unused-imports/no-unused-imports": "error",
|
|
15
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
16
|
+
},
|
|
17
|
+
plugins: {
|
|
18
|
+
"unused-imports": unusedImports,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.d.ts","sourceRoot":"","sources":["../../src/base/vitest.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,uEAGvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../eslint.config.ts"],"names":[],"mappings":";AAGA,wBAOG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,uEAAiC,CAAC"}
|
package/dist/node/n.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n.d.ts","sourceRoot":"","sources":["../../src/node/n.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,uEAEtB,CAAC"}
|
package/dist/node/n.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-react.d.ts","sourceRoot":"","sources":["../../src/react/eslint-react.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,uEAE7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,KAAK,uEAOjB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { base } from "../base/index.js";
|
|
2
|
+
import { eslintReactConfig } from "./eslint-react.js";
|
|
3
|
+
import { jsxA11yXConfig } from "./jsx-a11y-x.js";
|
|
4
|
+
import { reactHooksConfig } from "./react-hooks.js";
|
|
5
|
+
import { reactRefreshConfig } from "./react-refresh.js";
|
|
6
|
+
import { reactCompilerConfig } from "./react-compiler.js";
|
|
7
|
+
import { defineConfig } from "eslint/config";
|
|
8
|
+
export const react = defineConfig(base, eslintReactConfig, jsxA11yXConfig, reactHooksConfig, reactRefreshConfig, reactCompilerConfig);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-a11y-x.d.ts","sourceRoot":"","sources":["../../src/react/jsx-a11y-x.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,uEAA4C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-compiler.d.ts","sourceRoot":"","sources":["../../src/react/react-compiler.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,uEAE/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-hooks.d.ts","sourceRoot":"","sources":["../../src/react/react-hooks.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,uEAE5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-refresh.d.ts","sourceRoot":"","sources":["../../src/react/react-refresh.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,uEAE9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../../../src/base/eslint.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,uEAA2C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-lite.d.ts","sourceRoot":"","sources":["../../../src/base/import-lite.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,uEAQ5B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import importLite from "eslint-plugin-import-lite";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
export const importLiteConfig = defineConfig(importLite.configs.recommended, {
|
|
4
|
+
rules: {
|
|
5
|
+
"import-lite/consistent-type-specifier-style": ["error", "top-level"],
|
|
6
|
+
"import-lite/newline-after-import": "error",
|
|
7
|
+
},
|
|
8
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/base/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,IAAI,uEAWhB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import gitignore from "eslint-config-flat-gitignore";
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier/flat";
|
|
3
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
4
|
+
import { eslintConfig } from "./eslint.js";
|
|
5
|
+
import { importLiteConfig } from "./import-lite.js";
|
|
6
|
+
import { perfectionistConfig } from "./perfectionist.js";
|
|
7
|
+
import { typescriptEslintConfig } from "./typescript-eslint.js";
|
|
8
|
+
import { unicornXConfig } from "./unicorn-x.js";
|
|
9
|
+
import { unusedImportsConfig } from "./unused-imports.js";
|
|
10
|
+
import { vitestConfig } from "./vitest.js";
|
|
11
|
+
export const base = defineConfig(gitignore(), globalIgnores(["**/*.d.ts"]), eslintConfig, typescriptEslintConfig, unicornXConfig, vitestConfig, importLiteConfig, unusedImportsConfig, perfectionistConfig, eslintConfigPrettier);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perfectionist.d.ts","sourceRoot":"","sources":["../../../src/base/perfectionist.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,uEA8C9B,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import perfectionist from "eslint-plugin-perfectionist";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
export const perfectionistConfig = defineConfig({
|
|
4
|
+
plugins: {
|
|
5
|
+
perfectionist,
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
"perfectionist/sort-exports": [
|
|
9
|
+
"error",
|
|
10
|
+
{
|
|
11
|
+
order: "asc",
|
|
12
|
+
type: "natural",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
"perfectionist/sort-imports": [
|
|
16
|
+
"error",
|
|
17
|
+
{
|
|
18
|
+
groups: [
|
|
19
|
+
"type",
|
|
20
|
+
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
21
|
+
"builtin",
|
|
22
|
+
"external",
|
|
23
|
+
"internal",
|
|
24
|
+
["parent", "sibling", "index"],
|
|
25
|
+
"side-effect",
|
|
26
|
+
"object",
|
|
27
|
+
"unknown",
|
|
28
|
+
],
|
|
29
|
+
newlinesBetween: 0,
|
|
30
|
+
order: "asc",
|
|
31
|
+
type: "natural",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
"perfectionist/sort-named-exports": [
|
|
35
|
+
"error",
|
|
36
|
+
{
|
|
37
|
+
order: "asc",
|
|
38
|
+
type: "natural",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
"perfectionist/sort-named-imports": [
|
|
42
|
+
"error",
|
|
43
|
+
{
|
|
44
|
+
order: "asc",
|
|
45
|
+
type: "natural",
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-eslint.d.ts","sourceRoot":"","sources":["../../../src/base/typescript-eslint.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,uEASlC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
|
+
import typescriptEslint from "typescript-eslint";
|
|
3
|
+
export const typescriptEslintConfig = defineConfig(typescriptEslint.configs.strictTypeChecked, typescriptEslint.configs.stylisticTypeChecked, {
|
|
4
|
+
rules: {
|
|
5
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
6
|
+
"@typescript-eslint/explicit-module-boundary-types": "error",
|
|
7
|
+
},
|
|
8
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unicorn-x.d.ts","sourceRoot":"","sources":["../../../src/base/unicorn-x.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,uEAMzB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import unicornX from "eslint-plugin-unicorn-x";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
export const unicornXConfig = defineConfig(unicornX.configs.recommended, {
|
|
4
|
+
rules: {
|
|
5
|
+
"unicorn-x/prevent-abbreviations": "off",
|
|
6
|
+
"unicorn-x/better-regex": "error",
|
|
7
|
+
"unicorn-x/prefer-import-meta-properties": "error",
|
|
8
|
+
},
|
|
9
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unused-imports.d.ts","sourceRoot":"","sources":["../../../src/base/unused-imports.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,uEAiB9B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import unusedImports from "eslint-plugin-unused-imports";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
export const unusedImportsConfig = defineConfig({
|
|
4
|
+
rules: {
|
|
5
|
+
"unused-imports/no-unused-vars": [
|
|
6
|
+
"warn",
|
|
7
|
+
{
|
|
8
|
+
varsIgnorePattern: "^_",
|
|
9
|
+
argsIgnorePattern: "^_",
|
|
10
|
+
args: "after-used",
|
|
11
|
+
vars: "all",
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
"unused-imports/no-unused-imports": "error",
|
|
15
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
16
|
+
},
|
|
17
|
+
plugins: {
|
|
18
|
+
"unused-imports": unusedImports,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.d.ts","sourceRoot":"","sources":["../../../src/base/vitest.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY,uEAGvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,uEAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n.d.ts","sourceRoot":"","sources":["../../../src/node/n.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,uEAEtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-react.d.ts","sourceRoot":"","sources":["../../../src/react/eslint-react.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,uEAE7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,KAAK,uEAOjB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
|
+
import { base } from "../base/index.js";
|
|
3
|
+
import { eslintReactConfig } from "./eslint-react.js";
|
|
4
|
+
import { jsxA11yXConfig } from "./jsx-a11y-x.js";
|
|
5
|
+
import { reactCompilerConfig } from "./react-compiler.js";
|
|
6
|
+
import { reactHooksConfig } from "./react-hooks.js";
|
|
7
|
+
import { reactRefreshConfig } from "./react-refresh.js";
|
|
8
|
+
export const react = defineConfig(base, eslintReactConfig, jsxA11yXConfig, reactHooksConfig, reactRefreshConfig, reactCompilerConfig);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-a11y-x.d.ts","sourceRoot":"","sources":["../../../src/react/jsx-a11y-x.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc,uEAE1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-compiler.d.ts","sourceRoot":"","sources":["../../../src/react/react-compiler.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,uEAE/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-hooks.d.ts","sourceRoot":"","sources":["../../../src/react/react-hooks.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,uEAE5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-refresh.d.ts","sourceRoot":"","sources":["../../../src/react/react-refresh.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,uEAE9B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kasoa/eslint-config",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"description": "Kasoa's ESLint config",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"eslint",
|
|
9
|
+
"eslintconfig",
|
|
10
|
+
"kasoa"
|
|
11
|
+
],
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Emmanuel Chucks",
|
|
14
|
+
"email": "hi@emmanuelchucks.com",
|
|
15
|
+
"url": "https://emmanuelchucks.com"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/emmanuelchucks/kasoa/tree/main/packages/eslint-config",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/emmanuelchucks/kasoa.git",
|
|
21
|
+
"directory": "packages/eslint-config"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/emmanuelchucks/kasoa/issues"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"src",
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"exports": {
|
|
31
|
+
"./base": "./dist/base/index.js",
|
|
32
|
+
"./node": "./dist/node/index.js",
|
|
33
|
+
"./react": "./dist/react/index.js"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@eslint-react/eslint-plugin": "^1.53.1",
|
|
37
|
+
"@eslint/js": "latest",
|
|
38
|
+
"@vitest/eslint-plugin": "^1.3.12",
|
|
39
|
+
"eslint": "^9.35.0",
|
|
40
|
+
"eslint-config-flat-gitignore": "^2.1.0",
|
|
41
|
+
"eslint-config-prettier": "^10.1.8",
|
|
42
|
+
"eslint-plugin-import-lite": "^0.3.0",
|
|
43
|
+
"eslint-plugin-jsx-a11y-x": "^0.1.1",
|
|
44
|
+
"eslint-plugin-n": "^17.23.1",
|
|
45
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
46
|
+
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
47
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
48
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
49
|
+
"eslint-plugin-unicorn-x": "^3.2.1",
|
|
50
|
+
"eslint-plugin-unused-imports": "^4.2.0",
|
|
51
|
+
"globals": "^16.4.0",
|
|
52
|
+
"typescript-eslint": "^8.44.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/node": "^24.5.2",
|
|
56
|
+
"jiti": "^2.5.1",
|
|
57
|
+
"prettier": "^3.6.2",
|
|
58
|
+
"typescript": "^5.9.2",
|
|
59
|
+
"@kasoa/tsconfig": "0.0.0"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"eslint": "^9.35.0"
|
|
63
|
+
},
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=22.16.0"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"dev": "tsc --watch",
|
|
69
|
+
"build": "tsc",
|
|
70
|
+
"lint": "eslint --fix .",
|
|
71
|
+
"format": "prettier --write .",
|
|
72
|
+
"typecheck": "tsc --noEmit",
|
|
73
|
+
"check:all": "pnpm '/build|typecheck/'",
|
|
74
|
+
"test": "echo 'No tests'"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import importLite from "eslint-plugin-import-lite";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
|
|
4
|
+
export const importLiteConfig = defineConfig(
|
|
5
|
+
importLite.configs.recommended as never,
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
"import-lite/consistent-type-specifier-style": ["error", "top-level"],
|
|
9
|
+
"import-lite/newline-after-import": "error",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import gitignore from "eslint-config-flat-gitignore";
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier/flat";
|
|
3
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
4
|
+
import { eslintConfig } from "./eslint.js";
|
|
5
|
+
import { importLiteConfig } from "./import-lite.js";
|
|
6
|
+
import { perfectionistConfig } from "./perfectionist.js";
|
|
7
|
+
import { typescriptEslintConfig } from "./typescript-eslint.js";
|
|
8
|
+
import { unicornXConfig } from "./unicorn-x.js";
|
|
9
|
+
import { unusedImportsConfig } from "./unused-imports.js";
|
|
10
|
+
import { vitestConfig } from "./vitest.js";
|
|
11
|
+
|
|
12
|
+
export const base = defineConfig(
|
|
13
|
+
gitignore(),
|
|
14
|
+
globalIgnores(["**/*.d.ts"]),
|
|
15
|
+
eslintConfig,
|
|
16
|
+
typescriptEslintConfig,
|
|
17
|
+
unicornXConfig,
|
|
18
|
+
vitestConfig,
|
|
19
|
+
importLiteConfig,
|
|
20
|
+
unusedImportsConfig,
|
|
21
|
+
perfectionistConfig,
|
|
22
|
+
eslintConfigPrettier,
|
|
23
|
+
);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import perfectionist from "eslint-plugin-perfectionist";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
|
|
4
|
+
export const perfectionistConfig = defineConfig({
|
|
5
|
+
plugins: {
|
|
6
|
+
perfectionist,
|
|
7
|
+
},
|
|
8
|
+
rules: {
|
|
9
|
+
"perfectionist/sort-exports": [
|
|
10
|
+
"error",
|
|
11
|
+
{
|
|
12
|
+
order: "asc",
|
|
13
|
+
type: "natural",
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
"perfectionist/sort-imports": [
|
|
17
|
+
"error",
|
|
18
|
+
{
|
|
19
|
+
groups: [
|
|
20
|
+
"type",
|
|
21
|
+
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
22
|
+
"builtin",
|
|
23
|
+
"external",
|
|
24
|
+
"internal",
|
|
25
|
+
["parent", "sibling", "index"],
|
|
26
|
+
"side-effect",
|
|
27
|
+
"object",
|
|
28
|
+
"unknown",
|
|
29
|
+
],
|
|
30
|
+
newlinesBetween: 0,
|
|
31
|
+
order: "asc",
|
|
32
|
+
type: "natural",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
"perfectionist/sort-named-exports": [
|
|
36
|
+
"error",
|
|
37
|
+
{
|
|
38
|
+
order: "asc",
|
|
39
|
+
type: "natural",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
"perfectionist/sort-named-imports": [
|
|
43
|
+
"error",
|
|
44
|
+
{
|
|
45
|
+
order: "asc",
|
|
46
|
+
type: "natural",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
|
+
import typescriptEslint from "typescript-eslint";
|
|
3
|
+
|
|
4
|
+
export const typescriptEslintConfig = defineConfig(
|
|
5
|
+
typescriptEslint.configs.strictTypeChecked,
|
|
6
|
+
typescriptEslint.configs.stylisticTypeChecked,
|
|
7
|
+
{
|
|
8
|
+
rules: {
|
|
9
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
10
|
+
"@typescript-eslint/explicit-module-boundary-types": "error",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import unicornX from "eslint-plugin-unicorn-x";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
|
|
4
|
+
export const unicornXConfig = defineConfig(unicornX.configs.recommended, {
|
|
5
|
+
rules: {
|
|
6
|
+
"unicorn-x/prevent-abbreviations": "off",
|
|
7
|
+
"unicorn-x/better-regex": "error",
|
|
8
|
+
"unicorn-x/prefer-import-meta-properties": "error",
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import unusedImports from "eslint-plugin-unused-imports";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
|
|
4
|
+
export const unusedImportsConfig = defineConfig({
|
|
5
|
+
rules: {
|
|
6
|
+
"unused-imports/no-unused-vars": [
|
|
7
|
+
"warn",
|
|
8
|
+
{
|
|
9
|
+
varsIgnorePattern: "^_",
|
|
10
|
+
argsIgnorePattern: "^_",
|
|
11
|
+
args: "after-used",
|
|
12
|
+
vars: "all",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
"unused-imports/no-unused-imports": "error",
|
|
16
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
17
|
+
},
|
|
18
|
+
plugins: {
|
|
19
|
+
"unused-imports": unusedImports,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import vitest from "@vitest/eslint-plugin";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
|
|
4
|
+
interface Vitest {
|
|
5
|
+
configs: {
|
|
6
|
+
recommended: ReturnType<typeof defineConfig>[0];
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const vitestConfig = defineConfig({
|
|
11
|
+
files: ["**/tests/**", "**/*.test.ts"],
|
|
12
|
+
...(vitest as unknown as Vitest).configs.recommended,
|
|
13
|
+
});
|
package/src/node/n.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
|
+
import { base } from "../base/index.js";
|
|
3
|
+
import { eslintReactConfig } from "./eslint-react.js";
|
|
4
|
+
import { jsxA11yXConfig } from "./jsx-a11y-x.js";
|
|
5
|
+
import { reactCompilerConfig } from "./react-compiler.js";
|
|
6
|
+
import { reactHooksConfig } from "./react-hooks.js";
|
|
7
|
+
import { reactRefreshConfig } from "./react-refresh.js";
|
|
8
|
+
|
|
9
|
+
export const react = defineConfig(
|
|
10
|
+
base,
|
|
11
|
+
eslintReactConfig,
|
|
12
|
+
jsxA11yXConfig,
|
|
13
|
+
reactHooksConfig,
|
|
14
|
+
reactRefreshConfig,
|
|
15
|
+
reactCompilerConfig,
|
|
16
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @ts-expect-error - eslint-plugin-jsx-a11y-x is not typed
|
|
2
|
+
import jsxA11yX from "eslint-plugin-jsx-a11y-x";
|
|
3
|
+
import { defineConfig } from "eslint/config";
|
|
4
|
+
|
|
5
|
+
interface JSXA11y {
|
|
6
|
+
flatConfigs: {
|
|
7
|
+
strict: ReturnType<typeof defineConfig>[0];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const jsxA11yXConfig = defineConfig(
|
|
12
|
+
(jsxA11yX as JSXA11y).flatConfigs.strict,
|
|
13
|
+
);
|