@odg/eslint-config 2.0.1 → 2.0.3

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/index.js CHANGED
@@ -143,6 +143,132 @@ module.exports = {
143
143
  project: [ "tsconfig.json", "@odg/tsconfig/tsconfig.json" ], // Specify it only for TypeScript files
144
144
  },
145
145
  },
146
+ {
147
+ files: [ "*.tsx" ],
148
+ rules: {
149
+ "import/no-anonymous-default-export": [ "off" ],
150
+ "@typescript-eslint/naming-convention": [
151
+ "error",
152
+ {
153
+
154
+ selector: [
155
+ "function",
156
+ ],
157
+ format: [
158
+ "PascalCase",
159
+ "camelCase",
160
+ ],
161
+
162
+ // We allow double underscore because of GraphQL type names and some React names.
163
+ leadingUnderscore: "allowSingleOrDouble",
164
+ trailingUnderscore: "allow",
165
+
166
+ // Ignore `{'Retry-After': retryAfter}` type properties.
167
+ filter: {
168
+ regex: "[- ]",
169
+ match: false,
170
+ },
171
+ },
172
+ {
173
+
174
+ selector: [
175
+ "variable",
176
+ "function",
177
+ "parameterProperty",
178
+ "classMethod",
179
+ "objectLiteralMethod",
180
+ "typeMethod",
181
+ "accessor",
182
+ ],
183
+ format: [
184
+ "strictCamelCase",
185
+ "camelCase",
186
+ ],
187
+
188
+ // We allow double underscore because of GraphQL type names and some React names.
189
+ leadingUnderscore: "allowSingleOrDouble",
190
+ trailingUnderscore: "allow",
191
+
192
+ // Ignore `{'Retry-After': retryAfter}` type properties.
193
+ filter: {
194
+ regex: "[- ]",
195
+ match: false,
196
+ },
197
+ },
198
+ {
199
+ selector: "classProperty",
200
+ format: [
201
+ "strictCamelCase",
202
+ "camelCase",
203
+ "UPPER_CASE",
204
+ ],
205
+ },
206
+ {
207
+ selector: "typeLike",
208
+ format: [
209
+ "PascalCase",
210
+ "camelCase",
211
+ ],
212
+ },
213
+ {
214
+ selector: "variable",
215
+ types: [
216
+ "boolean",
217
+ ],
218
+ format: [
219
+ "StrictPascalCase",
220
+ ],
221
+ prefix: [
222
+ "is",
223
+ "has",
224
+ "can",
225
+ "should",
226
+ "will",
227
+ "did",
228
+ "does",
229
+ "are",
230
+ "do",
231
+ ],
232
+ },
233
+ {
234
+
235
+ selector: "interface",
236
+ format: [
237
+ "PascalCase",
238
+ ],
239
+ },
240
+ {
241
+
242
+ // Type parameter name should either be `T` or a descriptive name.
243
+ selector: "typeParameter",
244
+ filter: /^T$|^[A-Z][A-Za-z]+$/.source,
245
+ format: [
246
+ "StrictPascalCase",
247
+ ],
248
+ },
249
+
250
+ // Allow these in non-camel-case when quoted.
251
+ {
252
+ selector: [
253
+ "classProperty",
254
+ "objectLiteralProperty",
255
+ ],
256
+ format: null,
257
+ modifiers: [
258
+ "requiresQuotes",
259
+ ],
260
+ },
261
+ ],
262
+ },
263
+ },
264
+ {
265
+ files: [ "*.config.ts", "*.config.mts" ],
266
+ rules: {
267
+ "import/no-anonymous-default-export": [ "off" ],
268
+ "filenames/match-exported": [ "off" ],
269
+ "import/no-extraneous-dependencies": [ "off" ],
270
+ },
271
+ },
146
272
  {
147
273
  files: [ "*.json", "*.json5", "*.jsonc", ".eslintrc", "*.code-*" ],
148
274
  plugins: [ "jsonc" ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odg/eslint-config",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Linter for JavaScript And Typescript project",
5
5
  "main": "index.js",
6
6
  "author": "Dragons Gamers <https://www.linkedin.com/in/victor-alves-odgodinho>",
@@ -31,7 +31,7 @@ module.exports = {
31
31
  "no-throw-literal": [ "error" ], // Não permite throw "string" ou diferente de classe
32
32
  "no-empty-function": [ "error" ], // Não permite funções vazias
33
33
  "no-duplicate-imports": [ "error" ], // Bloqueia import duplicado
34
- "import/no-duplicates": [ "error" ], // Bloqueia import duplicado
34
+ "import/no-duplicates": [ "error", { "prefer-inline": true } ], // Bloqueia import duplicado
35
35
  "prefer-const": [ "error" ], // Preferir constantes
36
36
  "generator-star-spacing": [ "error", { before: true, after: false } ], // Espaço Funções Yield;
37
37
  "no-unsafe-optional-chaining": [
@@ -324,10 +324,15 @@ module.exports = {
324
324
  "**/vue.config.{js,ts}",
325
325
  "**/webpack.config.*.{js,ts}",
326
326
  "**/webpack.config.{js,ts}",
327
+ "*.config.ts",
328
+ "*.config.mts",
329
+ "electron",
330
+ "electron**",
327
331
  ],
328
332
  "optionalDependencies": true,
329
- "peerDependencies": false,
330
- "bundledDependencies": false,
333
+ "peerDependencies": true,
334
+ "bundledDependencies": true,
335
+ "bundleDependencies": true,
331
336
  },
332
337
  ], // Não dependa de pacotes em devDependencies
333
338
  "import/order": [
@@ -119,7 +119,6 @@ module.exports = {
119
119
  "@typescript-eslint/no-explicit-any": [ "error" ], // Não permite usar any
120
120
  "no-empty-function": [ "off" ], // Não permite funções vazias
121
121
  "@typescript-eslint/no-empty-function": [ "error" ], // Não permite funções vazias
122
- "no-duplicate-imports": [ "off" ], // Bloqueia import duplicado
123
122
  "@typescript-eslint/no-unnecessary-type-constraint": [
124
123
  "error",
125
124
  ], // Não permite restrições de tipo desnecessárias <T extends any>