@dubium/eslint-config 1.0.14 → 1.0.15
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 +62 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ yarn add -D prettier eslint-config-prettier eslint-plugin-prettier
|
|
|
65
65
|
|
|
66
66
|
## ⚙️ Usage
|
|
67
67
|
|
|
68
|
-
Create an `eslint.config.
|
|
68
|
+
Create an `eslint.config.cjs` file:
|
|
69
69
|
|
|
70
70
|
```js
|
|
71
71
|
import { defineConfig } from "eslint/config"
|
|
@@ -122,6 +122,67 @@ export default defineConfig( [
|
|
|
122
122
|
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
+
### Or Example for Nestjs
|
|
126
|
+
|
|
127
|
+
```js
|
|
128
|
+
import { defineConfig } from "eslint/config"
|
|
129
|
+
import { base } from "@dubium/eslint-config/base"
|
|
130
|
+
import { typescript } from "@dubium/eslint-config/typescript"
|
|
131
|
+
import globals from "globals"
|
|
132
|
+
import prettier from "eslint-config-prettier"
|
|
133
|
+
import eslintPluginPrettier from "eslint-plugin-prettier"
|
|
134
|
+
|
|
135
|
+
// Модифицируем typescript конфиг для поддержки type-aware правил
|
|
136
|
+
const enhancedTypescript = {
|
|
137
|
+
...typescript,
|
|
138
|
+
languageOptions: {
|
|
139
|
+
...typescript.languageOptions,
|
|
140
|
+
parserOptions: {
|
|
141
|
+
...(typescript.languageOptions?.parserOptions || {}),
|
|
142
|
+
project: "./tsconfig.json",
|
|
143
|
+
tsconfigRootDir: process.cwd(),
|
|
144
|
+
// Для поддержки path aliases (@/*)
|
|
145
|
+
EXPERIMENTAL_useProjectService: true,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export default defineConfig([
|
|
151
|
+
base,
|
|
152
|
+
enhancedTypescript,
|
|
153
|
+
{
|
|
154
|
+
plugins: {
|
|
155
|
+
prettier: eslintPluginPrettier,
|
|
156
|
+
},
|
|
157
|
+
rules: {
|
|
158
|
+
"prettier/prettier": "error",
|
|
159
|
+
},
|
|
160
|
+
languageOptions: {
|
|
161
|
+
globals: {
|
|
162
|
+
...globals.node,
|
|
163
|
+
...globals.jest,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
prettier,
|
|
168
|
+
{
|
|
169
|
+
rules: {
|
|
170
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
171
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
172
|
+
"new-cap": [
|
|
173
|
+
"error",
|
|
174
|
+
{
|
|
175
|
+
capIsNew: false,
|
|
176
|
+
newIsCap: false,
|
|
177
|
+
properties: true,
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
"class-methods-use-this": "off",
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
])
|
|
184
|
+
```
|
|
185
|
+
|
|
125
186
|
You can also use only the configs you need:
|
|
126
187
|
|
|
127
188
|
```js
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dubium/eslint-config",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"author": "https://github.com/DubiumEkb",
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"scripts": {
|
|
39
|
-
"version:push": "
|
|
39
|
+
"version:push": "npm publish --access=public",
|
|
40
40
|
"lint:inspect": "npx eslint --inspect-config"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|