@lzear/eslint-config 4.0.0 → 4.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/dist/index.js +17 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -200,7 +200,7 @@ var preferRelativeImports = {
|
|
|
200
200
|
create: (context) => {
|
|
201
201
|
const opts = context.options[0];
|
|
202
202
|
const maxParentPrefixes = opts?.maxParentPrefixes ?? 1;
|
|
203
|
-
const filename = context.physicalFilename
|
|
203
|
+
const filename = context.physicalFilename;
|
|
204
204
|
const check = (source) => {
|
|
205
205
|
const importPath = source.value;
|
|
206
206
|
if (typeof importPath !== "string" || importPath.startsWith(".")) {
|
|
@@ -278,6 +278,8 @@ var core = () => {
|
|
|
278
278
|
...regexpPlugin.configs.recommended.rules,
|
|
279
279
|
...sonarRules,
|
|
280
280
|
"sonarjs/fixme-tag": 0,
|
|
281
|
+
"sonarjs/no-invariant-returns": 0,
|
|
282
|
+
// annoying
|
|
281
283
|
"sonarjs/no-os-command-from-path": 0,
|
|
282
284
|
// annoying
|
|
283
285
|
"sonarjs/os-command": 0,
|
|
@@ -372,7 +374,7 @@ var node = async (config) => {
|
|
|
372
374
|
n: nodePlugin
|
|
373
375
|
},
|
|
374
376
|
rules: {
|
|
375
|
-
...nodePlugin.configs["flat/recommended"]
|
|
377
|
+
...nodePlugin.configs["flat/recommended"].rules,
|
|
376
378
|
"n/hashbang": 0,
|
|
377
379
|
// n resolver doesn't understand TypeScript imports; TypeScript handles this
|
|
378
380
|
"n/no-extraneous-import": 0,
|
|
@@ -407,6 +409,7 @@ var packageJson = () => ({
|
|
|
407
409
|
});
|
|
408
410
|
|
|
409
411
|
// configs/prettier.ts
|
|
412
|
+
import "eslint";
|
|
410
413
|
import prettierConfig from "eslint-plugin-prettier/recommended";
|
|
411
414
|
var prettier = {
|
|
412
415
|
...prettierConfig,
|
|
@@ -509,10 +512,21 @@ var typescript = async (config) => {
|
|
|
509
512
|
name: "lzear/typescript",
|
|
510
513
|
extends: [
|
|
511
514
|
eslint.configs.recommended,
|
|
512
|
-
tseslint.configs.
|
|
515
|
+
tseslint.configs.strictTypeChecked,
|
|
513
516
|
tseslint.configs.stylisticTypeChecked
|
|
514
517
|
],
|
|
515
518
|
files,
|
|
519
|
+
rules: {
|
|
520
|
+
"@typescript-eslint/no-unnecessary-condition": [
|
|
521
|
+
2,
|
|
522
|
+
{ allowConstantLoopConditions: "only-allowed-literals" }
|
|
523
|
+
],
|
|
524
|
+
"@typescript-eslint/no-unused-expressions": [2, { allowTernary: true }],
|
|
525
|
+
"@typescript-eslint/restrict-template-expressions": [
|
|
526
|
+
2,
|
|
527
|
+
{ allowNumber: true }
|
|
528
|
+
]
|
|
529
|
+
},
|
|
516
530
|
languageOptions: {
|
|
517
531
|
parser: typescriptParser,
|
|
518
532
|
parserOptions: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lzear/eslint-config",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"description": "Shared ESLint flat config for lzear repos",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"typescript-eslint": "^8"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@lzear/configs": "
|
|
61
|
+
"@lzear/configs": "4.0.3",
|
|
62
62
|
"@vitest/coverage-v8": "^4",
|
|
63
63
|
"eslint": "^9",
|
|
64
64
|
"tsup": "^8",
|
|
@@ -74,4 +74,4 @@
|
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
}
|
|
77
|
-
}
|
|
77
|
+
}
|