Skip to content

Commit 5e0153a

Browse files
committed
chore: update eslint config to support markdown linting
1 parent b265227 commit 5e0153a

File tree

4 files changed

+1237
-125
lines changed

4 files changed

+1237
-125
lines changed

eslint.config.mjs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ import _import from 'eslint-plugin-import';
88
import globals from 'globals';
99
import js from '@eslint/js';
1010
import json from '@eslint/json';
11+
import markdown from '@eslint/markdown';
1112
import prettier from 'eslint-plugin-prettier/recommended';
1213
import tseslint from 'typescript-eslint';
1314

1415

1516
export default defineConfig([
1617

17-
js.configs.recommended,
1818
_import.flatConfigs.recommended,
1919
_import.flatConfigs.typescript,
2020

2121
globalIgnores([
22-
'eslint.config.mjs',
2322
'out/*',
2423
'dist/*',
24+
'eslint.config.mjs',
2525
]),
2626

2727
tseslint.configs.recommendedTypeChecked,
@@ -31,6 +31,7 @@ export default defineConfig([
3131
'scripts/*.ts',
3232
'test/*.ts',
3333
],
34+
...js.configs.recommended,
3435

3536
languageOptions: {
3637
sourceType: 'module',
@@ -77,7 +78,7 @@ export default defineConfig([
7778
'no-duplicate-imports': 'error',
7879
'no-var': 'warn',
7980
'prefer-const': 'error',
80-
'quotes': ['error', 'ingle', {
81+
'quotes': ['error', 'single', {
8182
'allowTemplateLiterals': true,
8283
'avoidEscape': true,
8384
}],
@@ -102,14 +103,30 @@ export default defineConfig([
102103

103104
// Lint JSON
104105
{
105-
files: ['/**/*.json'],
106+
files: ['**/*.json'],
106107
ignores: ['package-lock.json'],
107108
plugins: { json },
108109
language: 'json/json',
109110
...json.configs.recommended,
110111
extends: [ tseslint.configs.disableTypeChecked],
111112
},
112113

113-
prettier,
114+
// Lint JSONC
115+
{
116+
files: ['**/*.jsonc', '.vscode/*.json'],
117+
plugins: { json },
118+
language: 'json/jsonc',
119+
...json.configs.recommended,
120+
},
121+
122+
// Lint Markdown
123+
{
124+
files: ['**/*.md'],
125+
plugins: { markdown },
126+
language: 'markdown/commonmark',
127+
extends: [ 'markdown/recommended', tseslint.configs.disableTypeChecked ],
128+
},
129+
130+
//prettier,
114131

115132
]);

0 commit comments

Comments
 (0)