@enormora/eslint-config-base 0.0.60 → 0.0.62
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/package.json +3 -3
- package/presets/base/dprint-config.js +2 -1
- package/presets/base/dprint-config.js.map +1 -1
- package/readme.md +26 -25
- package/sbom.cdx.json +15 -15
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@cspell/eslint-plugin": "10.0.1",
|
|
12
12
|
"@dprint/json": "0.23.0",
|
|
13
13
|
"@dprint/markdown": "0.22.1",
|
|
14
|
-
"@dprint/toml": "0.
|
|
14
|
+
"@dprint/toml": "0.8.0",
|
|
15
15
|
"@dprint/typescript": "0.96.1",
|
|
16
16
|
"@eslint-community/eslint-plugin-eslint-comments": "4.7.2",
|
|
17
17
|
"@eslint/markdown": "8.0.3",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"eslint-plugin-no-secrets": "2.3.3",
|
|
30
30
|
"eslint-plugin-package-json": "1.7.1",
|
|
31
31
|
"eslint-plugin-promise": "7.3.0",
|
|
32
|
-
"eslint-plugin-regexp": "3.
|
|
32
|
+
"eslint-plugin-regexp": "3.2.0",
|
|
33
33
|
"eslint-plugin-sonarjs": "4.2.0",
|
|
34
34
|
"eslint-plugin-unicorn": "73.0.0",
|
|
35
35
|
"jsonc-eslint-parser": "3.3.0"
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"./rule-sets/restricted-syntax.js"
|
|
74
74
|
],
|
|
75
75
|
"type": "module",
|
|
76
|
-
"version": "0.0.
|
|
76
|
+
"version": "0.0.62"
|
|
77
77
|
}
|
|
@@ -73,7 +73,8 @@ export const markdownDprintConfig = {
|
|
|
73
73
|
newLineKind: 'lf',
|
|
74
74
|
textWrap: 'maintain',
|
|
75
75
|
emphasisKind: 'underscores',
|
|
76
|
-
strongKind: 'asterisks'
|
|
76
|
+
strongKind: 'asterisks',
|
|
77
|
+
listIndentKind: 'pythonMarkdown'
|
|
77
78
|
};
|
|
78
79
|
export const yamlDprintConfig = {
|
|
79
80
|
printWidth: lineWidth,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dprint-config.js","sourceRoot":"","sources":["../../../../../configs/presets/base/dprint-config.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,SAAS;IACT,WAAW;IACX,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE,UAAU;IACtB,SAAS,EAAE,QAAQ;IACnB,aAAa,EAAE,UAAU;IACzB,kBAAkB,EAAE,UAAU;IAC9B,uBAAuB,EAAE,UAAU;IACnC,cAAc,EAAE,OAAO;IACvB,gBAAgB,EAAE,UAAU;IAC5B,aAAa,EAAE,KAAK;IACpB,gBAAgB,EAAE,KAAK;IACvB,8BAA8B,EAAE,OAAO;IACvC,oCAAoC,EAAE,KAAK;IAC3C,qBAAqB,EAAE,UAAU;IACjC,qCAAqC,EAAE,KAAK;IAC5C,qBAAqB,EAAE,QAAQ;IAC/B,oCAAoC,EAAE,IAAI;IAC1C,2BAA2B,EAAE,WAAW;IACxC,6BAA6B,EAAE,IAAI;IACnC,0BAA0B,EAAE,IAAI;IAChC,+BAA+B,EAAE,SAAS;IAC1C,WAAW,EAAE,KAAK;IAClB,0BAA0B,EAAE,IAAI;IAChC,+DAA+D,EAAE,IAAI;IACrE,oCAAoC,EAAE,IAAI;IAC1C,oCAAoC,EAAE,KAAK;IAC3C,sCAAsC,EAAE,IAAI;IAC5C,yCAAyC,EAAE,IAAI;IAC/C,yCAAyC,EAAE,IAAI;IAC/C,gDAAgD,EAAE,IAAI;IACtD,qCAAqC,EAAE,IAAI;IAC3C,qCAAqC,EAAE,IAAI;IAC3C,mCAAmC,EAAE,IAAI;IACzC,mCAAmC,EAAE,IAAI;IACzC,4CAA4C,EAAE,KAAK;IACnD,2CAA2C,EAAE,KAAK;IAClD,8CAA8C,EAAE,IAAI;IACpD,oCAAoC,EAAE,KAAK;IAC3C,iCAAiC,EAAE,IAAI;IACvC,gDAAgD,EAAE,IAAI;IACtD,wCAAwC,EAAE,IAAI;IAC9C,mDAAmD,EAAE,KAAK;IAC1D,+BAA+B,EAAE,KAAK;IACtC,oCAAoC,EAAE,KAAK;IAC3C,mCAAmC,EAAE,KAAK;IAC1C,iCAAiC,EAAE,KAAK;IACxC,qCAAqC,EAAE,KAAK;IAC5C,uCAAuC,EAAE,IAAI;IAC7C,+BAA+B,EAAE,UAAU;IAC3C,+BAA+B,EAAE,UAAU;IAC3C,oCAAoC,EAAE,UAAU;IAChD,oCAAoC,EAAE,UAAU;IAChD,mCAAmC,EAAE,KAAK;IAC1C,mCAAmC,EAAE,KAAK;IAC1C,kCAAkC,EAAE,OAAO;IAC3C,kCAAkC,EAAE,OAAO;CAC9C,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,SAAS;IACT,WAAW;IACX,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,SAAS;IACT,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,aAAa;IAC3B,UAAU,EAAE,WAAW;
|
|
1
|
+
{"version":3,"file":"dprint-config.js","sourceRoot":"","sources":["../../../../../configs/presets/base/dprint-config.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,SAAS;IACT,WAAW;IACX,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE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IAAI;IAC7C,+BAA+B,EAAE,UAAU;IAC3C,+BAA+B,EAAE,UAAU;IAC3C,oCAAoC,EAAE,UAAU;IAChD,oCAAoC,EAAE,UAAU;IAChD,mCAAmC,EAAE,KAAK;IAC1C,mCAAmC,EAAE,KAAK;IAC1C,kCAAkC,EAAE,OAAO;IAC3C,kCAAkC,EAAE,OAAO;CAC9C,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,SAAS;IACT,WAAW;IACX,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,SAAS;IACT,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,aAAa;IAC3B,UAAU,EAAE,WAAW;IACvB,cAAc,EAAE,gBAAgB;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,UAAU,EAAE,SAAS;IACrB,WAAW;IACX,SAAS,EAAE,IAAI;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,SAAS;IACT,WAAW;IACX,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK;CACjB,CAAC"}
|
package/readme.md
CHANGED
|
@@ -6,43 +6,44 @@ Base ESLint config preset, agnostic to any environment, framework, or library. T
|
|
|
6
6
|
|
|
7
7
|
Code formatting is handled by [dprint](https://dprint.dev/), wired into ESLint via the
|
|
8
8
|
[`@ben_12/eslint-plugin-dprint`](https://www.npmjs.com/package/@ben_12/eslint-plugin-dprint) plugin. TypeScript/JavaScript
|
|
9
|
-
files are formatted via the `dprint/typescript` rule, and JSON, Markdown, YAML, and TOML files are formatted via
|
|
10
|
-
|
|
9
|
+
files are formatted via the `dprint/typescript` rule, and JSON, Markdown, YAML, and TOML files are formatted via their
|
|
10
|
+
respective `dprint/*` rules. A single `eslint --fix` covers everything and there is no need for a separate
|
|
11
11
|
formatter step. The dprint configuration ships inline with this preset, so no `dprint.json` is required at the consumer
|
|
12
|
-
project root.
|
|
13
|
-
|
|
12
|
+
project root. Markdown list formatting uses dprint's `pythonMarkdown` indentation style, with nested list items indented
|
|
13
|
+
by four spaces. If you'd rather use prettier, use [`@enormora/eslint-config-base-with-prettier`](../base-with-prettier/base-with-prettier.md)
|
|
14
|
+
instead. It is an alternative base preset and is not meant to be combined with this one.
|
|
14
15
|
|
|
15
16
|
`package.json` files get dedicated semantic linting through two plugins, parsed by
|
|
16
17
|
[`jsonc-eslint-parser`](https://github.com/ota-meshi/jsonc-eslint-parser):
|
|
17
18
|
|
|
18
|
-
- **[`eslint-plugin-package-json`](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json)** (`package-json/*`)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
- **[`eslint-plugin-package-json`](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json)** (`package-json/*`):
|
|
20
|
+
validates the shape of every field that is present (author, repository, engines, exports, scripts, peers, etc.),
|
|
21
|
+
catches duplicate dependencies across `dependencies`/`devDependencies`/`peerDependencies`, sorts collections, and
|
|
22
|
+
enforces `repository` shorthand. The opinionated `require-*` rules (which would demand every package declare e.g.
|
|
23
|
+
`funding` or `cpu`) and `order-properties` are off; opt in by overriding individual rules in your own config.
|
|
23
24
|
- **[`eslint-plugin-json-schema-validator`](https://github.com/ota-meshi/eslint-plugin-json-schema-validator)**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
(`json-schema-validator/no-invalid`): validates the file against [schemastore.org](https://www.schemastore.org/)'s
|
|
26
|
+
`package.json` schema, catching invalid values that the field-shape rules above can't see (e.g. unknown
|
|
27
|
+
`engines.node` operators, malformed `exports` conditions).
|
|
27
28
|
|
|
28
29
|
Markdown files additionally get semantic linting through three language-aware plugins, all riding on
|
|
29
30
|
[`@eslint/markdown`](https://github.com/eslint/markdown)'s `language: "markdown/commonmark"`:
|
|
30
31
|
|
|
31
|
-
- **`@eslint/markdown`** (`markdown/*`)
|
|
32
|
-
|
|
32
|
+
- **`@eslint/markdown`** (`markdown/*`): heading order, missing alt text, broken link fragments, fenced-code
|
|
33
|
+
language, duplicate definitions, etc. (the official ESLint markdown plugin).
|
|
33
34
|
- **[`eslint-plugin-markdown-links`](https://github.com/ota-meshi/eslint-plugin-markdown-links)** (`markdown-links/*`)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
checks local file paths in markdown links/images exist on disk, that same-file `#fragment` targets exist, and
|
|
36
|
+
flags self-destination links. The network-based `no-dead-urls` is off by default to keep CI deterministic; flip it
|
|
37
|
+
on locally if you want it.
|
|
37
38
|
- **[`eslint-plugin-markdown-preferences`](https://github.com/ota-meshi/eslint-plugin-markdown-preferences)**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
(`markdown-preferences/*`): only the 8 rules from this plugin's `recommended` config are on (blockquote alignment,
|
|
40
|
+
hard-linebreak style, no-laziness blockquotes, prefer-autolinks, prefer-fenced-code-blocks, etc.). The other 45 are
|
|
41
|
+
off because they overlap with dprint formatting; flip on individually if a stricter style fits your project.
|
|
41
42
|
|
|
42
43
|
`@eslint/markdown` declares `language: "markdown/commonmark"` for `.md` files, so the AST root becomes an mdast
|
|
43
44
|
`root` node rather than an ESTree `Program`; a small in-repo adapter wraps `dprint/markdown` so it fires on the mdast
|
|
44
|
-
`root` selector and runs in the same pass as the linters. The published rule is `dprint-markdown/markdown`
|
|
45
|
-
behavior
|
|
45
|
+
`root` selector and runs in the same pass as the linters. The published rule is `dprint-markdown/markdown` with the
|
|
46
|
+
same behavior and config, just adapted to the markdown language.
|
|
46
47
|
|
|
47
48
|
(Why commonmark and not gfm? `@eslint/markdown@8.0.2`'s `MarkdownSourceCode` does not implement `getLoc()` for
|
|
48
49
|
GFM-specific nodes such as autolinks and table cells; under `language: "markdown/gfm"`, rules like `markdown/no-bare-urls`
|
|
@@ -114,7 +115,7 @@ therefore:
|
|
|
114
115
|
|
|
115
116
|
### Customizing or disabling a formatter
|
|
116
117
|
|
|
117
|
-
Because the formatter blocks are plain flat config, you override them the same way as any other ESLint config
|
|
118
|
+
Because the formatter blocks are plain flat config, you override them the same way as any other ESLint config by
|
|
118
119
|
adding a later block whose `files` glob overlaps the one you want to change. Later blocks win.
|
|
119
120
|
|
|
120
121
|
Disable a formatter entirely:
|
|
@@ -147,8 +148,8 @@ export default [
|
|
|
147
148
|
|
|
148
149
|
### Tweaking markdown lint rules
|
|
149
150
|
|
|
150
|
-
To override any markdown rule (from `@eslint/markdown`, `markdown-links`, or `markdown-preferences`), add a later
|
|
151
|
-
|
|
151
|
+
To override any markdown rule (from `@eslint/markdown`, `markdown-links`, or `markdown-preferences`), add a later block
|
|
152
|
+
with the same pattern as for any other ESLint rule:
|
|
152
153
|
|
|
153
154
|
```javascript
|
|
154
155
|
export default [
|
package/sbom.cdx.json
CHANGED
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
{
|
|
10
10
|
"type": "application",
|
|
11
11
|
"name": "packtory",
|
|
12
|
-
"version": "0.0.
|
|
12
|
+
"version": "0.0.97"
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "library",
|
|
18
18
|
"name": "@enormora/eslint-config-base",
|
|
19
|
-
"version": "0.0.
|
|
20
|
-
"bom-ref": "pkg:npm/@enormora/eslint-config-base@0.0.
|
|
21
|
-
"purl": "pkg:npm/@enormora/eslint-config-base@0.0.
|
|
19
|
+
"version": "0.0.62",
|
|
20
|
+
"bom-ref": "pkg:npm/@enormora/eslint-config-base@0.0.62",
|
|
21
|
+
"purl": "pkg:npm/@enormora/eslint-config-base@0.0.62"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [
|
|
@@ -77,15 +77,15 @@
|
|
|
77
77
|
{
|
|
78
78
|
"type": "library",
|
|
79
79
|
"name": "@dprint/toml",
|
|
80
|
-
"version": "0.
|
|
81
|
-
"bom-ref": "pkg:npm/@dprint/toml@0.
|
|
80
|
+
"version": "0.8.0",
|
|
81
|
+
"bom-ref": "pkg:npm/@dprint/toml@0.8.0",
|
|
82
82
|
"scope": "required",
|
|
83
83
|
"licenses": [
|
|
84
84
|
{
|
|
85
85
|
"expression": "MIT"
|
|
86
86
|
}
|
|
87
87
|
],
|
|
88
|
-
"purl": "pkg:npm/@dprint/toml@0.
|
|
88
|
+
"purl": "pkg:npm/@dprint/toml@0.8.0"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
"type": "library",
|
|
@@ -311,15 +311,15 @@
|
|
|
311
311
|
{
|
|
312
312
|
"type": "library",
|
|
313
313
|
"name": "eslint-plugin-regexp",
|
|
314
|
-
"version": "3.
|
|
315
|
-
"bom-ref": "pkg:npm/eslint-plugin-regexp@3.
|
|
314
|
+
"version": "3.2.0",
|
|
315
|
+
"bom-ref": "pkg:npm/eslint-plugin-regexp@3.2.0",
|
|
316
316
|
"scope": "required",
|
|
317
317
|
"licenses": [
|
|
318
318
|
{
|
|
319
319
|
"expression": "MIT"
|
|
320
320
|
}
|
|
321
321
|
],
|
|
322
|
-
"purl": "pkg:npm/eslint-plugin-regexp@3.
|
|
322
|
+
"purl": "pkg:npm/eslint-plugin-regexp@3.2.0"
|
|
323
323
|
},
|
|
324
324
|
{
|
|
325
325
|
"type": "library",
|
|
@@ -388,19 +388,19 @@
|
|
|
388
388
|
"ref": "pkg:npm/@dprint/markdown@0.22.1"
|
|
389
389
|
},
|
|
390
390
|
{
|
|
391
|
-
"ref": "pkg:npm/@dprint/toml@0.
|
|
391
|
+
"ref": "pkg:npm/@dprint/toml@0.8.0"
|
|
392
392
|
},
|
|
393
393
|
{
|
|
394
394
|
"ref": "pkg:npm/@dprint/typescript@0.96.1"
|
|
395
395
|
},
|
|
396
396
|
{
|
|
397
|
-
"ref": "pkg:npm/@enormora/eslint-config-base@0.0.
|
|
397
|
+
"ref": "pkg:npm/@enormora/eslint-config-base@0.0.62",
|
|
398
398
|
"dependsOn": [
|
|
399
399
|
"pkg:npm/@ben_12/eslint-plugin-dprint@1.23.0",
|
|
400
400
|
"pkg:npm/@cspell/eslint-plugin@10.0.1",
|
|
401
401
|
"pkg:npm/@dprint/json@0.23.0",
|
|
402
402
|
"pkg:npm/@dprint/markdown@0.22.1",
|
|
403
|
-
"pkg:npm/@dprint/toml@0.
|
|
403
|
+
"pkg:npm/@dprint/toml@0.8.0",
|
|
404
404
|
"pkg:npm/@dprint/typescript@0.96.1",
|
|
405
405
|
"pkg:npm/@eslint-community/eslint-plugin-eslint-comments@4.7.2",
|
|
406
406
|
"pkg:npm/@eslint/markdown@8.0.3",
|
|
@@ -418,7 +418,7 @@
|
|
|
418
418
|
"pkg:npm/eslint-plugin-no-secrets@2.3.3",
|
|
419
419
|
"pkg:npm/eslint-plugin-package-json@1.7.1",
|
|
420
420
|
"pkg:npm/eslint-plugin-promise@7.3.0",
|
|
421
|
-
"pkg:npm/eslint-plugin-regexp@3.
|
|
421
|
+
"pkg:npm/eslint-plugin-regexp@3.2.0",
|
|
422
422
|
"pkg:npm/eslint-plugin-sonarjs@4.2.0",
|
|
423
423
|
"pkg:npm/eslint-plugin-unicorn@73.0.0",
|
|
424
424
|
"pkg:npm/eslint@%5E10.0.0",
|
|
@@ -474,7 +474,7 @@
|
|
|
474
474
|
"ref": "pkg:npm/eslint-plugin-promise@7.3.0"
|
|
475
475
|
},
|
|
476
476
|
{
|
|
477
|
-
"ref": "pkg:npm/eslint-plugin-regexp@3.
|
|
477
|
+
"ref": "pkg:npm/eslint-plugin-regexp@3.2.0"
|
|
478
478
|
},
|
|
479
479
|
{
|
|
480
480
|
"ref": "pkg:npm/eslint-plugin-sonarjs@4.2.0"
|