@enormora/eslint-config-base 0.0.62 → 0.0.63
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/cspell-config.js +1 -17
- package/presets/base/cspell-config.js.map +1 -1
- package/presets/base/dprint-config.js +0 -89
- package/presets/base/dprint-config.js.map +1 -1
- package/presets/base/dprint-formatters.js +4 -20
- package/presets/base/dprint-formatters.js.map +1 -1
- package/presets/base/markdown-lint-rules.js +3 -102
- package/presets/base/markdown-lint-rules.js.map +1 -1
- package/presets/base/markdown.js +3 -32
- package/presets/base/markdown.js.map +1 -1
- package/presets/base/package-json.js +3 -111
- package/presets/base/package-json.js.map +1 -1
- package/presets/base/plain-text-language.js +1 -57
- package/presets/base/plain-text-language.js.map +1 -1
- package/rule-sets/best-practices.js +6 -724
- package/rule-sets/best-practices.js.map +1 -1
- package/sbom.cdx.json +15 -15
package/package.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
}
|
|
8
8
|
],
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@ben_12/eslint-plugin-dprint": "1.
|
|
11
|
-
"@cspell/eslint-plugin": "10.0
|
|
10
|
+
"@ben_12/eslint-plugin-dprint": "1.24.0",
|
|
11
|
+
"@cspell/eslint-plugin": "10.1.0",
|
|
12
12
|
"@dprint/json": "0.23.0",
|
|
13
13
|
"@dprint/markdown": "0.22.1",
|
|
14
14
|
"@dprint/toml": "0.8.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.63"
|
|
77
77
|
}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
import
|
|
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
|
-
}
|
|
1
|
+
import "./base-shared.js";
|
|
18
2
|
//# 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,
|
|
1
|
+
{"version":3,"file":"cspell-config.js","sourceRoot":"","sources":["../../../../../configs/presets/base/cspell-config.ts"],"names":[],"mappings":"AAAA,OAA0C,kBAAkB,CAAC"}
|
|
@@ -1,90 +1 @@
|
|
|
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
|
-
};
|
|
90
1
|
//# 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":""}
|
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import '@dprint/json';
|
|
3
|
+
import '@dprint/markdown';
|
|
4
|
+
import '@dprint/toml';
|
|
5
|
+
import '@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
|
-
};
|
|
28
12
|
//# 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,
|
|
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,103 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
-
};
|
|
1
|
+
import '@eslint/markdown';
|
|
2
|
+
import 'eslint-plugin-markdown-links';
|
|
3
|
+
import 'eslint-plugin-markdown-preferences';
|
|
103
4
|
//# 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,
|
|
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"}
|
package/presets/base/markdown.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import dprintPlugin from '@ben_12/eslint-plugin-dprint';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import "./dprint-config.js";
|
|
3
|
+
import "./dprint-formatters.js";
|
|
4
|
+
import "./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,33 +22,4 @@ 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
|
-
};
|
|
54
25
|
//# 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,
|
|
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;gBACzD,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;YACnC,CAAC;SACJ;KACJ;CACJ,CAAC;CAQE"}
|
|
@@ -1,112 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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/require-attribution': 'off',
|
|
67
|
-
'package-json/require-author': 'off',
|
|
68
|
-
'package-json/require-bin': 'off',
|
|
69
|
-
'package-json/require-browser': 'off',
|
|
70
|
-
'package-json/require-bugs': 'off',
|
|
71
|
-
'package-json/require-bundleDependencies': 'off',
|
|
72
|
-
'package-json/require-config': 'off',
|
|
73
|
-
'package-json/require-contributors': 'off',
|
|
74
|
-
'package-json/require-cpu': 'off',
|
|
75
|
-
'package-json/require-dependencies': 'off',
|
|
76
|
-
'package-json/require-description': 'off',
|
|
77
|
-
'package-json/require-devDependencies': 'off',
|
|
78
|
-
'package-json/require-devEngines': 'off',
|
|
79
|
-
'package-json/require-directories': 'off',
|
|
80
|
-
'package-json/require-engines': 'off',
|
|
81
|
-
'package-json/require-exports': 'off',
|
|
82
|
-
'package-json/require-files': 'off',
|
|
83
|
-
'package-json/require-funding': 'off',
|
|
84
|
-
'package-json/require-gypfile': 'off',
|
|
85
|
-
'package-json/require-homepage': 'off',
|
|
86
|
-
'package-json/require-keywords': 'off',
|
|
87
|
-
'package-json/require-libc': 'off',
|
|
88
|
-
'package-json/require-license': 'off',
|
|
89
|
-
'package-json/require-main': 'off',
|
|
90
|
-
'package-json/require-man': 'off',
|
|
91
|
-
'package-json/require-module': 'off',
|
|
92
|
-
'package-json/require-name': 'off',
|
|
93
|
-
'package-json/require-optionalDependencies': 'off',
|
|
94
|
-
'package-json/require-os': 'off',
|
|
95
|
-
'package-json/require-packageManager': 'off',
|
|
96
|
-
'package-json/require-peerDependencies': 'off',
|
|
97
|
-
'package-json/require-peerDependenciesMeta': 'off',
|
|
98
|
-
'package-json/require-private': 'off',
|
|
99
|
-
'package-json/require-publishConfig': 'off',
|
|
100
|
-
'package-json/require-repository': 'off',
|
|
101
|
-
'package-json/require-scripts': 'off',
|
|
102
|
-
'package-json/require-sideEffects': 'off',
|
|
103
|
-
'package-json/require-type': 'off',
|
|
104
|
-
'package-json/require-types': 'off',
|
|
105
|
-
'package-json/require-version': 'off',
|
|
106
|
-
'package-json/restrict-dependency-ranges': 'off',
|
|
107
|
-
'package-json/restrict-top-level-properties': 'off',
|
|
108
|
-
'package-json/specify-peers-locally': 'off',
|
|
109
|
-
'json-schema-validator/no-invalid': 'error'
|
|
110
|
-
}
|
|
111
|
-
};
|
|
1
|
+
import 'eslint-plugin-json-schema-validator';
|
|
2
|
+
import 'eslint-plugin-package-json';
|
|
3
|
+
import 'jsonc-eslint-parser';
|
|
112
4
|
//# 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,
|
|
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,58 +1,2 @@
|
|
|
1
|
-
import
|
|
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
|
-
};
|
|
1
|
+
import '@eslint/plugin-kit';
|
|
58
2
|
//# 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,
|
|
1
|
+
{"version":3,"file":"plain-text-language.js","sourceRoot":"","sources":["../../../../../configs/presets/base/plain-text-language.ts"],"names":[],"mappings":"AAAA,OAAkD,oBAAoB,CAAC;AAiB7C"}
|