@stefanolazzaroni/eslint-config 0.0.0-alpha.0 → 0.0.0-alpha.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/README.md +44 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npm install -D @stefanolazzaroni/eslint-config
|
|
|
15
15
|
_prettier.config.js_
|
|
16
16
|
|
|
17
17
|
```js
|
|
18
|
-
module.exports = require('@stefanolazzaroni/eslint-config/prettierrc.json')
|
|
18
|
+
module.exports = require('@stefanolazzaroni/eslint-config/prettierrc.json');
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## ESLint config
|
|
@@ -25,22 +25,28 @@ module.exports = require('@stefanolazzaroni/eslint-config/prettierrc.json')
|
|
|
25
25
|
_create eslint.config.mjs_
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
|
+
import tsParser from '@typescript-eslint/parser';
|
|
29
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
28
30
|
import react from '@stefanolazzaroni/eslint-config/react';
|
|
29
|
-
import
|
|
31
|
+
import path from 'node:path';
|
|
32
|
+
import { fileURLToPath } from 'node:url';
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
35
|
+
const __dirname = path.dirname(__filename);
|
|
36
|
+
|
|
37
|
+
export default defineConfig([
|
|
38
|
+
globalIgnores(['dist/**', '/node_modules/**', 'eslint.config.mjs']),
|
|
36
39
|
{
|
|
40
|
+
extends: [react],
|
|
37
41
|
languageOptions: {
|
|
42
|
+
parser: tsParser,
|
|
38
43
|
parserOptions: {
|
|
39
|
-
tsconfigRootDir:
|
|
44
|
+
tsconfigRootDir: __dirname,
|
|
45
|
+
projectService: true,
|
|
40
46
|
},
|
|
41
47
|
},
|
|
42
48
|
},
|
|
43
|
-
);
|
|
49
|
+
]);
|
|
44
50
|
```
|
|
45
51
|
|
|
46
52
|
### Next
|
|
@@ -48,22 +54,28 @@ export default tseslint.config(
|
|
|
48
54
|
_create eslint.config.mjs_
|
|
49
55
|
|
|
50
56
|
```ts
|
|
57
|
+
import tsParser from '@typescript-eslint/parser';
|
|
58
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
51
59
|
import next from '@stefanolazzaroni/eslint-config/next';
|
|
52
|
-
import
|
|
60
|
+
import path from 'node:path';
|
|
61
|
+
import { fileURLToPath } from 'node:url';
|
|
53
62
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
64
|
+
const __dirname = path.dirname(__filename);
|
|
65
|
+
|
|
66
|
+
export default defineConfig([
|
|
67
|
+
globalIgnores(['dist/**', '/node_modules/**', 'eslint.config.mjs']),
|
|
59
68
|
{
|
|
69
|
+
extends: [next],
|
|
60
70
|
languageOptions: {
|
|
71
|
+
parser: tsParser,
|
|
61
72
|
parserOptions: {
|
|
62
|
-
tsconfigRootDir:
|
|
73
|
+
tsconfigRootDir: __dirname,
|
|
74
|
+
projectService: true,
|
|
63
75
|
},
|
|
64
76
|
},
|
|
65
77
|
},
|
|
66
|
-
);
|
|
78
|
+
]);
|
|
67
79
|
```
|
|
68
80
|
|
|
69
81
|
### Nest
|
|
@@ -71,20 +83,26 @@ export default tseslint.config(
|
|
|
71
83
|
_create eslint.config.mjs_
|
|
72
84
|
|
|
73
85
|
```ts
|
|
86
|
+
import tsParser from '@typescript-eslint/parser';
|
|
87
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
74
88
|
import nest from '@stefanolazzaroni/eslint-config/nest';
|
|
75
|
-
import
|
|
89
|
+
import path from 'node:path';
|
|
90
|
+
import { fileURLToPath } from 'node:url';
|
|
76
91
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
92
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
93
|
+
const __dirname = path.dirname(__filename);
|
|
94
|
+
|
|
95
|
+
export default defineConfig([
|
|
96
|
+
globalIgnores(['dist/**', '/node_modules/**', 'eslint.config.mjs']),
|
|
82
97
|
{
|
|
98
|
+
extends: [nest],
|
|
83
99
|
languageOptions: {
|
|
100
|
+
parser: tsParser,
|
|
84
101
|
parserOptions: {
|
|
85
|
-
tsconfigRootDir:
|
|
102
|
+
tsconfigRootDir: __dirname,
|
|
103
|
+
projectService: true,
|
|
86
104
|
},
|
|
87
105
|
},
|
|
88
106
|
},
|
|
89
|
-
);
|
|
90
|
-
```
|
|
107
|
+
]);
|
|
108
|
+
```
|