@lzear/eslint-config 4.1.0 → 4.1.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/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ interface ConfigOptions {
5
5
  react: boolean;
6
6
  typescript: boolean;
7
7
  vitest: boolean;
8
+ local?: string;
8
9
  }
9
10
  declare const configGenerator: (options?: Partial<ConfigOptions>) => Promise<Linter.Config[]>;
10
11
 
package/dist/index.js CHANGED
@@ -23,11 +23,13 @@ var a11y = (config) => {
23
23
  // configs/core.ts
24
24
  import js from "@eslint/js";
25
25
  import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
26
+ import stylistic from "@stylistic/eslint-plugin";
26
27
  import deMorganPlugin from "eslint-plugin-de-morgan";
27
28
  import importXPlugin from "eslint-plugin-import-x";
28
29
  import preferArrowPlugin from "eslint-plugin-prefer-arrow";
29
30
  import promisePlugin from "eslint-plugin-promise";
30
31
  import regexpPlugin from "eslint-plugin-regexp";
32
+ import simpleImportSort from "eslint-plugin-simple-import-sort";
31
33
  import sonarjsPlugin from "eslint-plugin-sonarjs";
32
34
  import unicornPlugin from "eslint-plugin-unicorn";
33
35
  import globals from "globals";
@@ -237,7 +239,8 @@ var plugin = {
237
239
  };
238
240
 
239
241
  // configs/core.ts
240
- var core = () => {
242
+ var core = (local) => {
243
+ const l = local?.replaceAll(/[$()*+.?[\\\]^{|}]/g, String.raw`\$&`);
241
244
  const files = [
242
245
  "**/*.js",
243
246
  "**/*.cjs",
@@ -254,15 +257,33 @@ var core = () => {
254
257
  ...eslintCommentsPlugin.configs.recommended.rules,
255
258
  "@eslint-community/eslint-comments/disable-enable-pair": 0,
256
259
  "@eslint-community/eslint-comments/no-unlimited-disable": 0,
260
+ ...stylistic.configs.recommended.rules,
261
+ "@stylistic/arrow-parens": 0,
262
+ "@stylistic/brace-style": 0,
263
+ "@stylistic/jsx-self-closing-comp": [2, { component: true, html: true }],
257
264
  ...deMorganPlugin.configs.recommended.rules,
258
265
  ...importXPlugin.configs.recommended.rules,
266
+ "import-x/newline-after-import": 2,
267
+ "import-x/no-duplicates": [2, { "prefer-inline": true }],
268
+ "import-x/no-extraneous-dependencies": 2,
259
269
  "import-x/no-named-as-default-member": 0,
270
+ "import-x/no-relative-packages": 2,
260
271
  "import-x/no-unresolved": 0,
261
- "import-x/order": [
272
+ "import-x/order": 0,
273
+ "simple-import-sort/exports": 2,
274
+ "simple-import-sort/imports": [
262
275
  2,
263
276
  {
264
- alphabetize: { order: "asc", orderImportKind: "asc" },
265
- "newlines-between": "never"
277
+ groups: [
278
+ [
279
+ "^node:",
280
+ l && String.raw`^@?(?!` + l + String.raw`\/)\w`,
281
+ l && String.raw`^@` + l + String.raw`\/`,
282
+ "^",
283
+ String.raw`^\.`,
284
+ String.raw`^.+\.s?css$`
285
+ ].filter(Boolean)
286
+ ]
266
287
  }
267
288
  ],
268
289
  "lzear/prefer-relative-imports": 2,
@@ -277,9 +298,17 @@ var core = () => {
277
298
  ...promisePlugin.configs.recommended.rules,
278
299
  ...regexpPlugin.configs.recommended.rules,
279
300
  ...sonarRules,
301
+ "sonarjs/argument-type": 0,
302
+ // ?
280
303
  "sonarjs/fixme-tag": 0,
304
+ "sonarjs/function-return-type": 0,
305
+ // ?
306
+ "sonarjs/jsx-no-leaked-render": 0,
307
+ // false positives (not checking types)
281
308
  "sonarjs/no-invariant-returns": 0,
282
309
  // annoying
310
+ "sonarjs/no-nested-conditional": 0,
311
+ // unnecessary
283
312
  "sonarjs/no-os-command-from-path": 0,
284
313
  // annoying
285
314
  "sonarjs/os-command": 0,
@@ -310,12 +339,14 @@ var core = () => {
310
339
  },
311
340
  plugins: {
312
341
  "@eslint-community/eslint-comments": eslintCommentsPlugin,
342
+ "@stylistic": stylistic,
313
343
  "de-morgan": deMorganPlugin,
314
344
  "import-x": importXPlugin,
315
345
  lzear: plugin,
316
346
  "prefer-arrow": preferArrowPlugin,
317
347
  promise: promisePlugin,
318
348
  regexp: regexpPlugin,
349
+ "simple-import-sort": simpleImportSort,
319
350
  sonarjs: sonarjsPlugin,
320
351
  unicorn: unicornPlugin
321
352
  },
@@ -471,7 +502,7 @@ var react = async (config) => {
471
502
  "react-perf/jsx-no-new-object-as-prop": 0,
472
503
  ...reactPlugin.configs.recommended.rules,
473
504
  "react/react-in-jsx-scope": 0,
474
- "react/no-unknown-property": ["error", { ignore: ["jsx", "global"] }],
505
+ "react/no-unknown-property": [2, { ignore: ["jsx", "global"] }],
475
506
  ...config.typescript ? reactXPlugin.configs["recommended-typescript"].rules : reactXPlugin.configs.recommended.rules,
476
507
  ...reactDomPlugin.configs.recommended.rules,
477
508
  ...reactWebApiPlugin.configs.recommended.rules
@@ -512,6 +543,10 @@ var typescript = async (config) => {
512
543
  ],
513
544
  files,
514
545
  rules: {
546
+ "@typescript-eslint/no-misused-promises": [
547
+ 2,
548
+ { checksVoidReturn: { attributes: false } }
549
+ ],
515
550
  "@typescript-eslint/no-unnecessary-condition": [
516
551
  2,
517
552
  { allowConstantLoopConditions: "only-allowed-literals" }
@@ -602,7 +637,7 @@ var configGenerator = async (options = {}) => {
602
637
  ]);
603
638
  return [
604
639
  { name: "lzear/ignores", ignores },
605
- core(),
640
+ core(config.local),
606
641
  a11y(config),
607
642
  reactConfig,
608
643
  nodeConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lzear/eslint-config",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "Shared ESLint flat config for lzear repos",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,6 +29,7 @@
29
29
  "dependencies": {
30
30
  "@eslint-community/eslint-plugin-eslint-comments": "^4",
31
31
  "@eslint/js": "^9",
32
+ "@stylistic/eslint-plugin": "^5",
32
33
  "@vitest/eslint-plugin": "^1",
33
34
  "eslint-config-prettier": "^10",
34
35
  "eslint-import-resolver-typescript": "^4",
@@ -36,7 +37,7 @@
36
37
  "eslint-plugin-de-morgan": "^2",
37
38
  "eslint-plugin-import-x": "^4",
38
39
  "eslint-plugin-jsx-a11y": "^6",
39
- "eslint-plugin-n": "^17",
40
+ "eslint-plugin-n": "^18",
40
41
  "eslint-plugin-package-json": "^0.91",
41
42
  "eslint-plugin-prefer-arrow": "^1",
42
43
  "eslint-plugin-prettier": "^5",
@@ -49,6 +50,7 @@
49
50
  "eslint-plugin-react-web-api": "^5",
50
51
  "eslint-plugin-react-x": "^5",
51
52
  "eslint-plugin-regexp": "^3",
53
+ "eslint-plugin-simple-import-sort": "^13",
52
54
  "eslint-plugin-sonarjs": "^4",
53
55
  "eslint-plugin-unicorn": "^64",
54
56
  "globals": "^17",
@@ -57,7 +59,7 @@
57
59
  "typescript-eslint": "^8"
58
60
  },
59
61
  "devDependencies": {
60
- "@lzear/configs": "4.1.0",
62
+ "@lzear/configs": "workspace:*",
61
63
  "@vitest/coverage-v8": "^4",
62
64
  "eslint": "^9",
63
65
  "tsup": "^8",
@@ -73,4 +75,4 @@
73
75
  "publishConfig": {
74
76
  "access": "public"
75
77
  }
76
- }
78
+ }