@tarsilla/eslint-config 1.0.3 → 1.0.4
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 +89 -1
- package/lib/index.d.ts +1 -7
- package/lib/library/index.d.ts +1 -3
- package/lib/next/index.d.ts +1 -3
- package/lib/react/index.d.ts +1 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1 +1,89 @@
|
|
|
1
|
-
# eslint-config
|
|
1
|
+
# @tarsilla/eslint-config
|
|
2
|
+
|
|
3
|
+
This package provides a custom ESLint configuration built for ESLint v9. It enforces a consistent coding style and quality across Next.js, React and TypeScript library.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Custom Rule Sets**: Leverages recommended rules from @eslint/js, typescript-eslint, and various plugins.
|
|
8
|
+
- **Multiple Environments**: Offers tailored configurations for Next.js, React, and TypeScript library code.
|
|
9
|
+
- **Prettier**: Enforces consistent formatting with Prettier rules.
|
|
10
|
+
- **Unused Imports**: Detects and removes dead code using `eslint-plugin-unused-imports`.
|
|
11
|
+
- **Import Ordering**: Ensures a consistent and organized import structure using `eslint-plugin-import`.
|
|
12
|
+
- **Jest**: Ensures a consistent and organized tests using `eslint-plugin-jest`.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Install the configuration as a development dependency:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install --save-dev @tarsilla/eslint-config
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
or
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
yarn add --dev @tarsilla/eslint-config
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
In your ESLint configuration (see .eslintrc.mjs), add the plugin to your plugins array:
|
|
31
|
+
|
|
32
|
+
**Next.js Projects**
|
|
33
|
+
```js
|
|
34
|
+
import { eslintNextConfig } from '@tarsilla/eslint-config/next';
|
|
35
|
+
|
|
36
|
+
export default [
|
|
37
|
+
// ...other plugins...
|
|
38
|
+
...eslintNextConfig(),
|
|
39
|
+
];
|
|
40
|
+
```
|
|
41
|
+
**React Projects**
|
|
42
|
+
```js
|
|
43
|
+
import { eslintReactConfig } from '@tarsilla/eslint-config/react';
|
|
44
|
+
|
|
45
|
+
export default [
|
|
46
|
+
// ...other plugins...
|
|
47
|
+
...eslintReactConfig(),
|
|
48
|
+
];
|
|
49
|
+
```
|
|
50
|
+
**Typescript Library Projects**
|
|
51
|
+
```js
|
|
52
|
+
import { eslintLibraryConfig } from '@tarsilla/eslint-config/library';
|
|
53
|
+
|
|
54
|
+
export default [
|
|
55
|
+
// ...other plugins...
|
|
56
|
+
...eslintLibraryConfig(),
|
|
57
|
+
];
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Configuration Options
|
|
61
|
+
|
|
62
|
+
You can pass options to adjust the behavior of the config. For example, in the Next.js configuration:
|
|
63
|
+
```js
|
|
64
|
+
import { eslintNextConfig } from '@tarsilla/eslint-config/next';
|
|
65
|
+
|
|
66
|
+
export default [
|
|
67
|
+
// ...other plugins...
|
|
68
|
+
...eslintNextConfig({
|
|
69
|
+
ignores: ['**/node_modules/'],
|
|
70
|
+
}),
|
|
71
|
+
];
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Options
|
|
75
|
+
|
|
76
|
+
The plugin accepts an options object of type `EslintOptions`:
|
|
77
|
+
|
|
78
|
+
| Option | Type | Description | Default |
|
|
79
|
+
|----------|--------|--------------------------------------------------------------|-------------|
|
|
80
|
+
| ignores | string array | Array of paths to ignore during lint check. If not provided, the plugin will run in all files. | `undefined` |
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## Contributing
|
|
84
|
+
|
|
85
|
+
Contributions are welcome! Please ensure your pull request adheres to the project's linting and testing guidelines.
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
This project is licensed under the [MIT License](LICENSE).
|
package/lib/index.d.ts
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
2
|
|
|
3
3
|
type EslintOptions = {
|
|
4
4
|
ignores: string[];
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
7
|
declare function eslintLibraryConfig({ ignores }: EslintOptions): TSESLint.FlatConfig.ConfigArray;
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
9
|
declare function eslintNextConfig({ ignores }: EslintOptions): TSESLint.FlatConfig.ConfigArray;
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
11
|
declare function eslintReactConfig({ ignores }: EslintOptions): TSESLint.FlatConfig.ConfigArray;
|
|
18
12
|
|
|
19
13
|
export { eslintLibraryConfig, eslintNextConfig, eslintReactConfig };
|
package/lib/library/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
2
|
|
|
3
3
|
type EslintOptions = {
|
|
4
4
|
ignores: string[];
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
7
|
declare function eslintLibraryConfig({ ignores }: EslintOptions): TSESLint.FlatConfig.ConfigArray;
|
|
10
8
|
|
|
11
9
|
export { eslintLibraryConfig };
|
package/lib/next/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
2
|
|
|
3
3
|
type EslintOptions = {
|
|
4
4
|
ignores: string[];
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
7
|
declare function eslintNextConfig({ ignores }: EslintOptions): TSESLint.FlatConfig.ConfigArray;
|
|
10
8
|
|
|
11
9
|
export { eslintNextConfig };
|
package/lib/react/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
2
|
|
|
3
3
|
type EslintOptions = {
|
|
4
4
|
ignores: string[];
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
7
|
declare function eslintReactConfig({ ignores }: EslintOptions): TSESLint.FlatConfig.ConfigArray;
|
|
10
8
|
|
|
11
9
|
export { eslintReactConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarsilla/eslint-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -67,17 +67,17 @@
|
|
|
67
67
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
68
68
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
69
69
|
"prettier": "^3.5.3",
|
|
70
|
-
"typescript-eslint": "^8.
|
|
70
|
+
"typescript-eslint": "^8.27.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
74
74
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
75
75
|
"@rollup/plugin-swc": "^0.4.0",
|
|
76
76
|
"@rollup/plugin-terser": "^0.4.4",
|
|
77
|
-
"@tarsilla/commit-wizard": "^1.0.
|
|
77
|
+
"@tarsilla/commit-wizard": "^1.0.4",
|
|
78
78
|
"husky": "^9.1.7",
|
|
79
79
|
"rollup": "^4.36.0",
|
|
80
|
-
"rollup-plugin-dts": "^6.2.
|
|
80
|
+
"rollup-plugin-dts": "^6.2.1",
|
|
81
81
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
82
82
|
"typescript": "^5.8.2"
|
|
83
83
|
}
|