@tarsilla/eslint-config 1.0.3 → 1.0.5

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 CHANGED
@@ -1 +1,91 @@
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
+
34
+ ```js
35
+ import { eslintNextConfig } from '@tarsilla/eslint-config/next';
36
+
37
+ export default [
38
+ // ...other plugins...
39
+ ...eslintNextConfig(),
40
+ ];
41
+ ```
42
+ **React Projects**
43
+
44
+ ```js
45
+ import { eslintReactConfig } from '@tarsilla/eslint-config/react';
46
+
47
+ export default [
48
+ // ...other plugins...
49
+ ...eslintReactConfig(),
50
+ ];
51
+ ```
52
+ **Typescript Library Projects**
53
+
54
+ ```js
55
+ import { eslintLibraryConfig } from '@tarsilla/eslint-config/library';
56
+
57
+ export default [
58
+ // ...other plugins...
59
+ ...eslintLibraryConfig(),
60
+ ];
61
+ ```
62
+
63
+ ## Configuration Options
64
+
65
+ You can override default settings by creating passing options to the plugin.
66
+ The plugin accepts an object of type `EslintOptions`:
67
+
68
+ | Option | Type | Description | Default |
69
+ |----------|--------|--------------------------------------------------------------|-------------|
70
+ | ignores | string array | Array of paths to ignore during lint check. If not provided, the plugin will run in all files. | `undefined` |
71
+
72
+ Example `Next.js`:
73
+
74
+ ```js
75
+ import { eslintNextConfig } from '@tarsilla/eslint-config/next';
76
+
77
+ export default [
78
+ // ...other plugins...
79
+ ...eslintNextConfig({
80
+ ignores: ['**/node_modules/'],
81
+ }),
82
+ ];
83
+ ```
84
+
85
+ ## Contributing
86
+
87
+ Contributions are welcome! Please ensure your pull request adheres to the project's linting and testing guidelines.
88
+
89
+ ## License
90
+
91
+ This project is licensed under the [MIT License](LICENSE).
package/lib/index.d.ts CHANGED
@@ -1,19 +1,13 @@
1
- import type { TSESLint } from '@typescript-eslint/utils';
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 };
@@ -1,11 +1,9 @@
1
- import type { TSESLint } from '@typescript-eslint/utils';
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 };
@@ -1,11 +1,9 @@
1
- import type { TSESLint } from '@typescript-eslint/utils';
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 };
@@ -1,11 +1,9 @@
1
- import type { TSESLint } from '@typescript-eslint/utils';
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",
3
+ "version": "1.0.5",
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.26.1"
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.1",
77
+ "@tarsilla/commit-wizard": "^1.0.5",
78
78
  "husky": "^9.1.7",
79
79
  "rollup": "^4.36.0",
80
- "rollup-plugin-dts": "^6.2.0",
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
  }