@enormora/eslint-config-base 0.0.64 → 0.0.66

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 CHANGED
@@ -7,17 +7,17 @@
7
7
  }
8
8
  ],
9
9
  "dependencies": {
10
- "@ben_12/eslint-plugin-dprint": "1.25.1",
11
- "@cspell/eslint-plugin": "10.2.0",
10
+ "@ben_12/eslint-plugin-dprint": "1.26.0",
11
+ "@cspell/eslint-plugin": "10.3.0",
12
12
  "@dprint/json": "0.23.0",
13
- "@dprint/markdown": "0.23.2",
13
+ "@dprint/markdown": "0.24.0",
14
14
  "@dprint/toml": "0.8.0",
15
15
  "@dprint/typescript": "0.96.1",
16
- "@eslint-community/eslint-plugin-eslint-comments": "4.7.2",
16
+ "@eslint-community/eslint-plugin-eslint-comments": "4.8.1",
17
17
  "@eslint/markdown": "8.0.3",
18
- "@eslint/plugin-kit": "0.7.2",
18
+ "@eslint/plugin-kit": "0.7.3",
19
19
  "@stylistic/eslint-plugin": "5.10.0",
20
- "@typescript-eslint/utils": "8.67.0",
20
+ "@typescript-eslint/utils": "8.69.0",
21
21
  "dprint-plugin-yaml": "0.6.0",
22
22
  "eslint-plugin-array-func": "5.1.1",
23
23
  "eslint-plugin-destructuring": "2.2.1",
@@ -27,9 +27,9 @@
27
27
  "eslint-plugin-markdown-preferences": "0.42.0",
28
28
  "eslint-plugin-no-barrel-files": "2.2.0",
29
29
  "eslint-plugin-no-secrets": "2.3.3",
30
- "eslint-plugin-package-json": "1.7.1",
30
+ "eslint-plugin-package-json": "1.8.0",
31
31
  "eslint-plugin-promise": "7.3.0",
32
- "eslint-plugin-regexp": "3.2.0",
32
+ "eslint-plugin-regexp": "3.3.0",
33
33
  "eslint-plugin-sonarjs": "4.2.0",
34
34
  "eslint-plugin-unicorn": "74.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.64"
76
+ "version": "0.0.66"
77
77
  }
@@ -1,2 +1,18 @@
1
- import "./base-shared.js";
1
+ import { cspellSpellcheckerOptions } from "./base-shared.js";
2
+ export function withCspellWords(words) {
3
+ return {
4
+ rules: {
5
+ '@cspell/spellchecker': [
6
+ 'error',
7
+ {
8
+ ...cspellSpellcheckerOptions,
9
+ cspell: {
10
+ ...cspellSpellcheckerOptions.cspell,
11
+ words: [...cspellSpellcheckerOptions.cspell.words, ...words]
12
+ }
13
+ }
14
+ ]
15
+ }
16
+ };
17
+ }
2
18
  //# sourceMappingURL=cspell-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cspell-config.js","sourceRoot":"","sources":["../../../../../configs/presets/base/cspell-config.ts"],"names":[],"mappings":"AAAA,OAA0C,kBAAkB,CAAC"}
1
+ {"version":3,"file":"cspell-config.js","sourceRoot":"","sources":["../../../../../configs/presets/base/cspell-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAU7D,MAAM,UAAU,eAAe,CAAC,KAAwB;IACpD,OAAO;QACH,KAAK,EAAE;YACH,sBAAsB,EAAE;gBACpB,OAAO;gBACP;oBACI,GAAG,yBAAyB;oBAC5B,MAAM,EAAE;wBACJ,GAAG,yBAAyB,CAAC,MAAM;wBACnC,KAAK,EAAE,CAAE,GAAG,yBAAyB,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,KAAK,CAAE;qBACjE;iBACJ;aACJ;SACJ;KACJ,CAAC;AACN,CAAC"}
@@ -1 +1,90 @@
1
+ const lineWidth = 120;
2
+ const indentWidth = 4;
3
+ export const typescriptDprintConfig = {
4
+ lineWidth,
5
+ indentWidth,
6
+ newLineKind: 'lf',
7
+ useTabs: false,
8
+ semiColons: 'always',
9
+ quoteStyle: 'preferSingle',
10
+ quoteProps: 'asNeeded',
11
+ useBraces: 'always',
12
+ bracePosition: 'sameLine',
13
+ singleBodyPosition: 'nextLine',
14
+ nextControlFlowPosition: 'sameLine',
15
+ trailingCommas: 'never',
16
+ operatorPosition: 'maintain',
17
+ preferHanging: false,
18
+ preferSingleLine: false,
19
+ 'arrowFunction.useParentheses': 'force',
20
+ 'binaryExpression.linePerExpression': false,
21
+ 'jsx.bracketPosition': 'nextLine',
22
+ 'jsx.forceNewLinesSurroundingContent': false,
23
+ 'jsx.multiLineParens': 'prefer',
24
+ 'memberExpression.linePerExpression': true,
25
+ 'typeLiteral.separatorKind': 'semiColon',
26
+ 'arrayExpression.spaceAround': true,
27
+ 'arrayPattern.spaceAround': true,
28
+ 'enumDeclaration.memberSpacing': 'newLine',
29
+ spaceAround: false,
30
+ spaceSurroundingProperties: true,
31
+ 'binaryExpression.spaceSurroundingBitwiseAndArithmeticOperator': true,
32
+ 'commentLine.forceSpaceAfterSlashes': true,
33
+ 'constructor.spaceBeforeParentheses': false,
34
+ 'constructorType.spaceAfterNewKeyword': true,
35
+ 'constructSignature.spaceAfterNewKeyword': true,
36
+ 'doWhileStatement.spaceAfterWhileKeyword': true,
37
+ 'exportDeclaration.spaceSurroundingNamedExports': true,
38
+ 'forInStatement.spaceAfterForKeyword': true,
39
+ 'forOfStatement.spaceAfterForKeyword': true,
40
+ 'forStatement.spaceAfterForKeyword': true,
41
+ 'forStatement.spaceAfterSemiColons': true,
42
+ 'functionDeclaration.spaceBeforeParentheses': false,
43
+ 'functionExpression.spaceBeforeParentheses': false,
44
+ 'functionExpression.spaceAfterFunctionKeyword': true,
45
+ 'getAccessor.spaceBeforeParentheses': false,
46
+ 'ifStatement.spaceAfterIfKeyword': true,
47
+ 'importDeclaration.spaceSurroundingNamedImports': true,
48
+ 'jsxSelfClosingElement.spaceBeforeSlash': true,
49
+ 'jsxExpressionContainer.spaceSurroundingExpression': false,
50
+ 'method.spaceBeforeParentheses': false,
51
+ 'setAccessor.spaceBeforeParentheses': false,
52
+ 'taggedTemplate.spaceBeforeLiteral': false,
53
+ 'typeAnnotation.spaceBeforeColon': false,
54
+ 'typeAssertion.spaceBeforeExpression': false,
55
+ 'whileStatement.spaceAfterWhileKeyword': true,
56
+ 'module.sortImportDeclarations': 'maintain',
57
+ 'module.sortExportDeclarations': 'maintain',
58
+ 'exportDeclaration.sortNamedExports': 'maintain',
59
+ 'importDeclaration.sortNamedImports': 'maintain',
60
+ 'exportDeclaration.forceSingleLine': false,
61
+ 'importDeclaration.forceSingleLine': false,
62
+ 'exportDeclaration.forceMultiLine': 'never',
63
+ 'importDeclaration.forceMultiLine': 'never'
64
+ };
65
+ export const jsonDprintConfig = {
66
+ lineWidth,
67
+ indentWidth,
68
+ newLineKind: 'lf',
69
+ useTabs: false
70
+ };
71
+ export const markdownDprintConfig = {
72
+ lineWidth,
73
+ newLineKind: 'lf',
74
+ textWrap: 'maintain',
75
+ emphasisKind: 'underscores',
76
+ strongKind: 'asterisks',
77
+ listIndentKind: 'pythonMarkdown'
78
+ };
79
+ export const yamlDprintConfig = {
80
+ printWidth: lineWidth,
81
+ indentWidth,
82
+ lineBreak: 'lf'
83
+ };
84
+ export const tomlDprintConfig = {
85
+ lineWidth,
86
+ indentWidth,
87
+ newLineKind: 'lf',
88
+ useTabs: false
89
+ };
1
90
  //# sourceMappingURL=dprint-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dprint-config.js","sourceRoot":"","sources":["../../../../../configs/presets/base/dprint-config.ts"],"names":[],"mappings":""}
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;IAC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;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"}
@@ -1,12 +1,28 @@
1
1
  import { fileURLToPath } from 'node:url';
2
- import '@dprint/json';
3
- import '@dprint/markdown';
4
- import '@dprint/toml';
5
- import '@dprint/typescript';
2
+ import dprintJsonFormatter from '@dprint/json';
3
+ import dprintMarkdownFormatter from '@dprint/markdown';
4
+ import dprintTomlFormatter from '@dprint/toml';
5
+ import dprintTypescriptFormatter from '@dprint/typescript';
6
6
  // `dprint-plugin-yaml` ships only `plugin.wasm` and `package.json` — there is no JS entry to import
7
7
  // from. Packtory's dependency scanner records `import.meta.resolve('<pkg>/plugin.wasm')` call sites
8
8
  // (since `@packtory/cli@0.0.31`), so this call is what makes the package land in the published
9
9
  // `dependencies`. The dprint plugin reads the bytes itself when it resolves a `getPath`-shaped
10
10
  // formatter, so we just hand it the path.
11
11
  const dprintYamlWasmPath = fileURLToPath(import.meta.resolve('dprint-plugin-yaml/plugin.wasm'));
12
+ const dprintYamlFormatter = {
13
+ getPath() {
14
+ return dprintYamlWasmPath;
15
+ }
16
+ };
17
+ export const dprintSettings = {
18
+ '@ben_12/dprint': {
19
+ formatters: {
20
+ typescript: dprintTypescriptFormatter,
21
+ json: dprintJsonFormatter,
22
+ markdown: dprintMarkdownFormatter,
23
+ toml: dprintTomlFormatter,
24
+ yaml: dprintYamlFormatter
25
+ }
26
+ }
27
+ };
12
28
  //# sourceMappingURL=dprint-formatters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dprint-formatters.js","sourceRoot":"","sources":["../../../../../configs/presets/base/dprint-formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAgC,cAAc,CAAC;AAC/C,OAAoC,kBAAkB,CAAC;AACvD,OAAgC,cAAc,CAAC;AAC/C,OAAsC,oBAAoB,CAAC;AAE3D,oGAAoG;AACpG,oGAAoG;AACpG,+FAA+F;AAC/F,+FAA+F;AAC/F,0CAA0C;AAC1C,MAAM,kBAAkB,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"dprint-formatters.js","sourceRoot":"","sources":["../../../../../configs/presets/base/dprint-formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,mBAAmB,MAAM,cAAc,CAAC;AAC/C,OAAO,uBAAuB,MAAM,kBAAkB,CAAC;AACvD,OAAO,mBAAmB,MAAM,cAAc,CAAC;AAC/C,OAAO,yBAAyB,MAAM,oBAAoB,CAAC;AAE3D,oGAAoG;AACpG,oGAAoG;AACpG,+FAA+F;AAC/F,+FAA+F;AAC/F,0CAA0C;AAC1C,MAAM,kBAAkB,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC,CAAC;AAEhG,MAAM,mBAAmB,GAAG;IACxB,OAAO;QACH,OAAO,kBAAkB,CAAC;IAC9B,CAAC;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,gBAAgB,EAAE;QACd,UAAU,EAAE;YACR,UAAU,EAAE,yBAAyB;YACrC,IAAI,EAAE,mBAAmB;YACzB,QAAQ,EAAE,uBAAuB;YACjC,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,mBAAmB;SAC5B;KACJ;CACJ,CAAC"}
@@ -1,4 +1,103 @@
1
- import '@eslint/markdown';
2
- import 'eslint-plugin-markdown-links';
3
- import 'eslint-plugin-markdown-preferences';
1
+ import markdownPlugin from '@eslint/markdown';
2
+ import markdownLinksPlugin from 'eslint-plugin-markdown-links';
3
+ import markdownPreferencesPlugin from 'eslint-plugin-markdown-preferences';
4
+ export const markdownLintPlugins = {
5
+ markdown: markdownPlugin,
6
+ 'markdown-links': markdownLinksPlugin,
7
+ 'markdown-preferences': markdownPreferencesPlugin
8
+ };
9
+ export const markdownLintRules = {
10
+ 'markdown/fenced-code-language': 'error',
11
+ 'markdown/fenced-code-meta': 'off',
12
+ 'markdown/heading-increment': 'error',
13
+ 'markdown/no-bare-urls': 'error',
14
+ 'markdown/no-duplicate-definitions': 'error',
15
+ 'markdown/no-duplicate-headings': 'error',
16
+ 'markdown/no-empty-definitions': 'error',
17
+ 'markdown/no-empty-images': 'error',
18
+ 'markdown/no-empty-links': 'error',
19
+ 'markdown/no-html': 'error',
20
+ 'markdown/no-invalid-label-refs': 'error',
21
+ 'markdown/no-missing-atx-heading-space': 'error',
22
+ // Allow the three GFM task-list checkbox markers (`[ ]`, `[x]`, `[X]`). The commonmark
23
+ // language has no concept of task lists, so the rule otherwise reports the checkbox content
24
+ // as a missing label reference.
25
+ 'markdown/no-missing-label-refs': ['error', { allowLabels: ['', 'x', 'X'] }],
26
+ 'markdown/no-missing-link-fragments': 'error',
27
+ 'markdown/no-multiple-h1': 'error',
28
+ 'markdown/no-reference-like-urls': 'error',
29
+ 'markdown/no-reversed-media-syntax': 'error',
30
+ 'markdown/no-space-in-emphasis': 'error',
31
+ 'markdown/no-unused-definitions': 'error',
32
+ 'markdown/require-alt-text': 'error',
33
+ 'markdown/table-column-count': 'error',
34
+ // markdown-links: external network check is opt-in to keep CI deterministic;
35
+ // local-path and fragment checks are pure wins.
36
+ 'markdown-links/no-dead-urls': 'off',
37
+ 'markdown-links/no-missing-fragments': 'error',
38
+ 'markdown-links/no-missing-path': 'error',
39
+ 'markdown-links/no-self-destination': 'error',
40
+ // markdown-preferences: many rules overlap with the active markdown formatter (dprint or
41
+ // prettier, depending on which base preset is used). We enable only 7 rules from this
42
+ // plugin's `recommended` config (none of which fight either formatter) and explicitly turn
43
+ // the other 46 off. Override individually if a stricter style is desired.
44
+ //
45
+ // `prefer-autolinks` is intentionally disabled even though it is in `recommended`: its
46
+ // autofix rewrites any `[x](x)` to `<x>` without checking whether the URL has a scheme.
47
+ // CommonMark autolinks require an absolute URI, so a relative link like `[foo.md](foo.md)`
48
+ // becomes `<foo.md>`, which GitHub renders as an empty HTML tag (the link disappears).
49
+ 'markdown-preferences/atx-heading-closing-sequence': 'off',
50
+ 'markdown-preferences/atx-heading-closing-sequence-length': 'off',
51
+ 'markdown-preferences/blockquote-marker-alignment': 'error',
52
+ 'markdown-preferences/bullet-list-marker-style': 'off',
53
+ 'markdown-preferences/canonical-code-block-language': 'off',
54
+ 'markdown-preferences/code-fence-length': 'off',
55
+ 'markdown-preferences/code-fence-spacing': 'off',
56
+ 'markdown-preferences/code-fence-style': 'off',
57
+ 'markdown-preferences/custom-container-marker-spacing': 'off',
58
+ 'markdown-preferences/definitions-last': 'off',
59
+ 'markdown-preferences/emoji-notation': 'off',
60
+ 'markdown-preferences/emphasis-delimiters-style': 'off',
61
+ 'markdown-preferences/hard-linebreak-style': 'error',
62
+ 'markdown-preferences/heading-casing': 'off',
63
+ 'markdown-preferences/indent': 'off',
64
+ 'markdown-preferences/level1-heading-style': 'off',
65
+ 'markdown-preferences/level2-heading-style': 'off',
66
+ 'markdown-preferences/link-bracket-newline': 'off',
67
+ 'markdown-preferences/link-bracket-spacing': 'off',
68
+ 'markdown-preferences/link-destination-style': 'off',
69
+ 'markdown-preferences/link-paren-newline': 'off',
70
+ 'markdown-preferences/link-paren-spacing': 'off',
71
+ 'markdown-preferences/link-title-style': 'off',
72
+ 'markdown-preferences/list-marker-alignment': 'error',
73
+ 'markdown-preferences/max-len': 'off',
74
+ 'markdown-preferences/no-heading-trailing-punctuation': 'off',
75
+ 'markdown-preferences/no-implicit-block-closing': 'error',
76
+ 'markdown-preferences/no-laziness-blockquotes': 'error',
77
+ 'markdown-preferences/no-multi-spaces': 'off',
78
+ 'markdown-preferences/no-multiple-empty-lines': 'off',
79
+ 'markdown-preferences/no-tabs': 'off',
80
+ 'markdown-preferences/no-text-backslash-linebreak': 'error',
81
+ 'markdown-preferences/no-trailing-spaces': 'off',
82
+ 'markdown-preferences/ordered-list-marker-sequence': 'off',
83
+ 'markdown-preferences/ordered-list-marker-start': 'off',
84
+ 'markdown-preferences/ordered-list-marker-style': 'off',
85
+ 'markdown-preferences/padded-custom-containers': 'off',
86
+ 'markdown-preferences/padding-line-between-blocks': 'off',
87
+ 'markdown-preferences/prefer-autolinks': 'off',
88
+ 'markdown-preferences/prefer-fenced-code-blocks': 'error',
89
+ 'markdown-preferences/prefer-inline-code-words': 'off',
90
+ 'markdown-preferences/prefer-link-reference-definitions': 'off',
91
+ 'markdown-preferences/prefer-linked-words': 'off',
92
+ 'markdown-preferences/setext-heading-underline-length': 'off',
93
+ 'markdown-preferences/sort-definitions': 'off',
94
+ 'markdown-preferences/strikethrough-delimiters-style': 'off',
95
+ 'markdown-preferences/table-header-casing': 'off',
96
+ 'markdown-preferences/table-leading-trailing-pipes': 'off',
97
+ 'markdown-preferences/table-pipe-alignment': 'off',
98
+ 'markdown-preferences/table-pipe-spacing': 'off',
99
+ 'markdown-preferences/thematic-break-character-style': 'off',
100
+ 'markdown-preferences/thematic-break-length': 'off',
101
+ 'markdown-preferences/thematic-break-sequence-pattern': 'off'
102
+ };
4
103
  //# sourceMappingURL=markdown-lint-rules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-lint-rules.js","sourceRoot":"","sources":["../../../../../configs/presets/base/markdown-lint-rules.ts"],"names":[],"mappings":"AAAA,OAA2B,kBAAkB,CAAC;AAE9C,OAAgC,8BAA8B,CAAC;AAC/D,OAAsC,oCAAoC,CAAC"}
1
+ {"version":3,"file":"markdown-lint-rules.js","sourceRoot":"","sources":["../../../../../configs/presets/base/markdown-lint-rules.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,yBAAyB,MAAM,oCAAoC,CAAC;AAE3E,MAAM,CAAC,MAAM,mBAAmB,GAAkC;IAC9D,QAAQ,EAAE,cAAc;IACxB,gBAAgB,EAAE,mBAAmB;IACrC,sBAAsB,EAAE,yBAAyB;CACpD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,+BAA+B,EAAE,OAAO;IACxC,2BAA2B,EAAE,KAAK;IAClC,4BAA4B,EAAE,OAAO;IACrC,uBAAuB,EAAE,OAAO;IAChC,mCAAmC,EAAE,OAAO;IAC5C,gCAAgC,EAAE,OAAO;IACzC,+BAA+B,EAAE,OAAO;IACxC,0BAA0B,EAAE,OAAO;IACnC,yBAAyB,EAAE,OAAO;IAClC,kBAAkB,EAAE,OAAO;IAC3B,gCAAgC,EAAE,OAAO;IACzC,uCAAuC,EAAE,OAAO;IAChD,uFAAuF;IACvF,4FAA4F;IAC5F,gCAAgC;IAChC,gCAAgC,EAAE,CAAE,OAAO,EAAE,EAAE,WAAW,EAAE,CAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAE,EAAE,CAAE;IAChF,oCAAoC,EAAE,OAAO;IAC7C,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IAC7C,8CAA8C,EAAE,KAAK;IACrD,8BAA8B,EAAE,KAAK;IACrC,kDAAkD,EAAE,OAAO;IAC3D,yCAAyC,EAAE,KAAK;IAChD,mDAAmD,EAAE,KAAK;IAC1D,gDAAgD,EAAE,KAAK;IACvD,gDAAgD,EAAE,KAAK;IACvD,+CAA+C,EAAE,KAAK;IACtD,kDAAkD,EAAE,KAAK;IACzD,uCAAuC,EAAE,KAAK;IAC9C,gDAAgD,EAAE,OAAO;IACzD,+CAA+C,EAAE,KAAK;IACtD,wDAAwD,EAAE,KAAK;IAC/D,0CAA0C,EAAE,KAAK;IACjD,sDAAsD,EAAE,KAAK;IAC7D,uCAAuC,EAAE,KAAK;IAC9C,qDAAqD,EAAE,KAAK;IAC5D,0CAA0C,EAAE,KAAK;IACjD,mDAAmD,EAAE,KAAK;IAC1D,2CAA2C,EAAE,KAAK;IAClD,yCAAyC,EAAE,KAAK;IAChD,qDAAqD,EAAE,KAAK;IAC5D,4CAA4C,EAAE,KAAK;IACnD,sDAAsD,EAAE,KAAK;CAChE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import dprintPlugin from '@ben_12/eslint-plugin-dprint';
2
- import "./dprint-config.js";
3
- import "./dprint-formatters.js";
4
- import "./markdown-lint-rules.js";
2
+ import { jsonDprintConfig, markdownDprintConfig, tomlDprintConfig, typescriptDprintConfig, yamlDprintConfig } from "./dprint-config.js";
3
+ import { dprintSettings } from "./dprint-formatters.js";
4
+ import { markdownLintPlugins, markdownLintRules } from "./markdown-lint-rules.js";
5
5
  // `@eslint/markdown` declares `language: 'markdown/commonmark'` for .md files, which makes ESLint
6
6
  // parse them into an mdast tree (root node `type: 'root'`). The stock `dprint/markdown` rule listens
7
7
  // on the ESTree selector `Program` and therefore never fires under that language, silently turning
@@ -22,4 +22,33 @@ const dprintMarkdownLanguageAdapter = {
22
22
  }
23
23
  }
24
24
  };
25
+ export const markdownConfig = {
26
+ files: ['**/*.md'],
27
+ plugins: {
28
+ ...markdownLintPlugins,
29
+ 'dprint-markdown': dprintMarkdownLanguageAdapter
30
+ },
31
+ // Pinned to commonmark because @eslint/markdown@8.0.2's MarkdownSourceCode does not implement
32
+ // getLoc() for GFM-specific nodes (autolinks, tableCell, etc.). Rules such as
33
+ // markdown/no-bare-urls and markdown/table-column-count fire under gfm but then crash ESLint
34
+ // 10's reporter ("Custom getLoc() method must be implemented in the subclass"). Revisit once
35
+ // @eslint/markdown ships a fix.
36
+ language: 'markdown/commonmark',
37
+ settings: dprintSettings,
38
+ rules: {
39
+ 'dprint-markdown/markdown': [
40
+ 'error',
41
+ {
42
+ config: markdownDprintConfig,
43
+ hostConfigs: {
44
+ typescript: typescriptDprintConfig,
45
+ json: jsonDprintConfig,
46
+ toml: tomlDprintConfig,
47
+ yaml: yamlDprintConfig
48
+ }
49
+ }
50
+ ],
51
+ ...markdownLintRules
52
+ }
53
+ };
25
54
  //# sourceMappingURL=markdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../../../configs/presets/base/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,8BAA8B,CAAC;AAExD,OAMO,oBAAoB,CAAC;AAC5B,OAA+B,wBAAwB,CAAC;AACxD,OAAuD,0BAA0B,CAAC;AAElF,kGAAkG;AAClG,qGAAqG;AACrG,mGAAmG;AACnG,qGAAqG;AACrG,iGAAiG;AACjG,MAAM,0BAA0B,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC;AAC/D,IAAI,0BAA0B,KAAK,SAAS,EAAE,CAAC;IAC3C,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;AAC1E,CAAC;AACD,MAAM,6BAA6B,GAAG;IAClC,KAAK,EAAE;QACH,QAAQ,EAAE;YACN,IAAI,EAAE,0BAA0B,CAAC,IAAI;YACrC,MAAM,CAAC,OAAyB;gBAC5B,MAAM,KAAK,GAAG,0BAA0B,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBACz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B;IAC/B,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE;QACH,0BAA0B,EAAE;YACxB,OAAO;YACP;gBACI,MAAM,EAAE,oBAAoB;gBAC5B,WAAW,EAAE;oBACT,UAAU,EAAE,sBAAsB;oBAClC,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,gBAAgB;iBACzB;aACJ;SACJ;QAED,GAAG,iBAAiB;KACvB;CACwB,CAAC"}
@@ -1,4 +1,113 @@
1
- import 'eslint-plugin-json-schema-validator';
2
- import 'eslint-plugin-package-json';
3
- import 'jsonc-eslint-parser';
1
+ import jsonSchemaValidatorPlugin from 'eslint-plugin-json-schema-validator';
2
+ import packageJsonPlugin from 'eslint-plugin-package-json';
3
+ import * as jsoncParser from 'jsonc-eslint-parser';
4
+ export const packageJsonConfig = {
5
+ files: ['**/package.json'],
6
+ languageOptions: { parser: jsoncParser },
7
+ plugins: {
8
+ 'package-json': packageJsonPlugin,
9
+ 'json-schema-validator': jsonSchemaValidatorPlugin
10
+ },
11
+ rules: {
12
+ 'package-json/no-empty-fields': 'error',
13
+ 'package-json/no-redundant-files': 'error',
14
+ 'package-json/no-redundant-publishConfig': 'error',
15
+ 'package-json/repository-shorthand': 'error',
16
+ 'package-json/restrict-private-properties': 'error',
17
+ 'package-json/scripts-name-casing': 'error',
18
+ 'package-json/sort-collections': 'error',
19
+ 'package-json/unique-dependencies': 'error',
20
+ 'package-json/valid-author': 'error',
21
+ 'package-json/valid-bin': 'error',
22
+ 'package-json/valid-browser': 'error',
23
+ 'package-json/valid-bugs': 'error',
24
+ 'package-json/valid-bundleDependencies': 'error',
25
+ 'package-json/valid-config': 'error',
26
+ 'package-json/valid-contributors': 'error',
27
+ 'package-json/valid-cpu': 'error',
28
+ 'package-json/valid-dependencies': 'error',
29
+ 'package-json/valid-description': 'error',
30
+ 'package-json/valid-devDependencies': 'error',
31
+ 'package-json/valid-devEngines': 'error',
32
+ 'package-json/valid-directories': 'error',
33
+ 'package-json/valid-engines': 'error',
34
+ 'package-json/valid-exports': 'error',
35
+ 'package-json/valid-files': 'error',
36
+ 'package-json/valid-funding': 'error',
37
+ 'package-json/valid-gypfile': 'error',
38
+ 'package-json/valid-homepage': 'error',
39
+ 'package-json/valid-keywords': 'error',
40
+ 'package-json/valid-libc': 'error',
41
+ 'package-json/valid-license': 'error',
42
+ 'package-json/valid-main': 'error',
43
+ 'package-json/valid-man': 'error',
44
+ 'package-json/valid-module': 'error',
45
+ 'package-json/valid-name': 'error',
46
+ 'package-json/valid-optionalDependencies': 'error',
47
+ 'package-json/valid-os': 'error',
48
+ 'package-json/valid-packageManager': 'error',
49
+ 'package-json/valid-peerDependencies': 'error',
50
+ 'package-json/valid-peerDependenciesMeta': 'error',
51
+ 'package-json/valid-peerDependenciesMeta-relationship': 'error',
52
+ 'package-json/valid-private': 'error',
53
+ 'package-json/valid-publishConfig': 'error',
54
+ 'package-json/valid-repository': 'error',
55
+ 'package-json/valid-repository-directory': 'error',
56
+ 'package-json/valid-scripts': 'error',
57
+ 'package-json/valid-sideEffects': 'error',
58
+ 'package-json/valid-type': 'error',
59
+ 'package-json/valid-version': 'error',
60
+ 'package-json/valid-workspaces': 'error',
61
+ // Too opinionated for a base preset — consumers can opt in.
62
+ 'package-json/bin-name-casing': 'off',
63
+ 'package-json/exports-subpaths-style': 'off',
64
+ 'package-json/no-local-dependencies': 'off',
65
+ 'package-json/order-properties': 'off',
66
+ 'package-json/prefer-rolling-workspace-spec': 'off',
67
+ 'package-json/require-attribution': 'off',
68
+ 'package-json/require-author': 'off',
69
+ 'package-json/require-bin': 'off',
70
+ 'package-json/require-browser': 'off',
71
+ 'package-json/require-bugs': 'off',
72
+ 'package-json/require-bundleDependencies': 'off',
73
+ 'package-json/require-config': 'off',
74
+ 'package-json/require-contributors': 'off',
75
+ 'package-json/require-cpu': 'off',
76
+ 'package-json/require-dependencies': 'off',
77
+ 'package-json/require-description': 'off',
78
+ 'package-json/require-devDependencies': 'off',
79
+ 'package-json/require-devEngines': 'off',
80
+ 'package-json/require-directories': 'off',
81
+ 'package-json/require-engines': 'off',
82
+ 'package-json/require-exports': 'off',
83
+ 'package-json/require-files': 'off',
84
+ 'package-json/require-funding': 'off',
85
+ 'package-json/require-gypfile': 'off',
86
+ 'package-json/require-homepage': 'off',
87
+ 'package-json/require-keywords': 'off',
88
+ 'package-json/require-libc': 'off',
89
+ 'package-json/require-license': 'off',
90
+ 'package-json/require-main': 'off',
91
+ 'package-json/require-man': 'off',
92
+ 'package-json/require-module': 'off',
93
+ 'package-json/require-name': 'off',
94
+ 'package-json/require-optionalDependencies': 'off',
95
+ 'package-json/require-os': 'off',
96
+ 'package-json/require-packageManager': 'off',
97
+ 'package-json/require-peerDependencies': 'off',
98
+ 'package-json/require-peerDependenciesMeta': 'off',
99
+ 'package-json/require-private': 'off',
100
+ 'package-json/require-publishConfig': 'off',
101
+ 'package-json/require-repository': 'off',
102
+ 'package-json/require-scripts': 'off',
103
+ 'package-json/require-sideEffects': 'off',
104
+ 'package-json/require-type': 'off',
105
+ 'package-json/require-types': 'off',
106
+ 'package-json/require-version': 'off',
107
+ 'package-json/restrict-dependency-ranges': 'off',
108
+ 'package-json/restrict-top-level-properties': 'off',
109
+ 'package-json/specify-peers-locally': 'off',
110
+ 'json-schema-validator/no-invalid': 'error'
111
+ }
112
+ };
4
113
  //# sourceMappingURL=package-json.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"package-json.js","sourceRoot":"","sources":["../../../../../configs/presets/base/package-json.ts"],"names":[],"mappings":"AACA,OAAsC,qCAAqC,CAAC;AAC5E,OAA8B,4BAA4B,CAAC;AAC3D,OAA6B,qBAAqB,CAAC"}
1
+ {"version":3,"file":"package-json.js","sourceRoot":"","sources":["../../../../../configs/presets/base/package-json.ts"],"names":[],"mappings":"AACA,OAAO,yBAAyB,MAAM,qCAAqC,CAAC;AAC5E,OAAO,iBAAiB,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,WAAW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EAAE,KAAK;QAChC,qCAAqC,EAAE,KAAK;QAC5C,uCAAuC,EAAE,KAAK;QAC9C,2CAA2C,EAAE,KAAK;QAClD,8BAA8B,EAAE,KAAK;QACrC,oCAAoC,EAAE,KAAK;QAC3C,iCAAiC,EAAE,KAAK;QACxC,8BAA8B,EAAE,KAAK;QACrC,kCAAkC,EAAE,KAAK;QACzC,2BAA2B,EAAE,KAAK;QAClC,4BAA4B,EAAE,KAAK;QACnC,8BAA8B,EAAE,KAAK;QACrC,yCAAyC,EAAE,KAAK;QAChD,4CAA4C,EAAE,KAAK;QACnD,oCAAoC,EAAE,KAAK;QAE3C,kCAAkC,EAAE,OAAO;KAC9C;CACwB,CAAC"}
@@ -1,2 +1,58 @@
1
- import '@eslint/plugin-kit';
1
+ import { TextSourceCodeBase, VisitNodeStep } from '@eslint/plugin-kit';
2
+ const lineEndingPattern = /\r\n|\n|\r/u;
3
+ function buildProgramNode(text) {
4
+ const lines = text.split(lineEndingPattern);
5
+ const lastLine = lines.at(-1) ?? '';
6
+ return {
7
+ type: 'Program',
8
+ body: [],
9
+ comments: [],
10
+ tokens: [],
11
+ range: [0, text.length],
12
+ loc: {
13
+ start: { line: 1, column: 0 },
14
+ end: { line: lines.length, column: lastLine.length }
15
+ }
16
+ };
17
+ }
18
+ function* traverseProgram(ast) {
19
+ yield new VisitNodeStep({ target: ast, phase: 1, args: [ast] });
20
+ yield new VisitNodeStep({ target: ast, phase: 2, args: [ast] });
21
+ }
22
+ function createPlainTextSourceCode(file, parseResult) {
23
+ const sourceCode = new TextSourceCodeBase({ text: file.body, ast: parseResult.ast });
24
+ Object.assign(sourceCode, {
25
+ getLoc(node) {
26
+ return node.loc;
27
+ },
28
+ getRange(node) {
29
+ return node.range;
30
+ },
31
+ traverse() {
32
+ return traverseProgram(parseResult.ast);
33
+ }
34
+ });
35
+ return sourceCode;
36
+ }
37
+ function noopValidateLanguageOptions() {
38
+ return undefined;
39
+ }
40
+ function parsePlainText(file) {
41
+ return { ok: true, ast: buildProgramNode(file.body) };
42
+ }
43
+ const plainTextLanguage = {
44
+ fileType: 'text',
45
+ lineStart: 1,
46
+ columnStart: 0,
47
+ nodeTypeKey: 'type',
48
+ visitorKeys: { Program: [] },
49
+ defaultLanguageOptions: {},
50
+ validateLanguageOptions: noopValidateLanguageOptions,
51
+ parse: parsePlainText,
52
+ createSourceCode: createPlainTextSourceCode
53
+ };
54
+ export const plainTextLanguagePlugin = {
55
+ meta: { name: '@enormora/eslint-config-plain-text-language', version: '1.0.0' },
56
+ languages: { any: plainTextLanguage }
57
+ };
2
58
  //# sourceMappingURL=plain-text-language.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plain-text-language.js","sourceRoot":"","sources":["../../../../../configs/presets/base/plain-text-language.ts"],"names":[],"mappings":"AAAA,OAAkD,oBAAoB,CAAC;AAiB7C"}
1
+ {"version":3,"file":"plain-text-language.js","sourceRoot":"","sources":["../../../../../configs/presets/base/plain-text-language.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAiBvE,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAExC,SAAS,gBAAgB,CAAC,IAAY;IAClC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACpC,OAAO;QACH,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,CAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAE;QACzB,GAAG,EAAE;YACD,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;YAC7B,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,QA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