Skip to content

Commit 050f5d1

Browse files
committed
Add eslint config, rules
1 parent 67754ec commit 050f5d1

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

eslint.config.mjs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
import tsParser from '@typescript-eslint/parser'
12
import { configs } from 'eslint-plugin-devup'
3+
import jsonc from 'eslint-plugin-jsonc'
4+
import * as mdx from 'eslint-plugin-mdx'
5+
import jsonParser from 'jsonc-eslint-parser'
26

3-
export default configs.recommended
7+
export default [
8+
...configs.recommended,
9+
{
10+
files: ['**/*.{json,json5,jsonc}'],
11+
languageOptions: { parser: jsonParser },
12+
plugins: { jsonc },
13+
rules: {
14+
'prettier/prettier': 'off',
15+
'eol-last': ['error', 'never'],
16+
'no-multiple-empty-lines': ['error', { max: 0, maxEOF: 0 }],
17+
},
18+
},
19+
{
20+
...mdx.flat,
21+
files: ['**/*.{md,mdx}'],
22+
processor: mdx.createRemarkProcessor({
23+
lintCodeBlocks: true,
24+
}),
25+
},
26+
{
27+
...mdx.flatCodeBlocks,
28+
files: ['**/*.{md,mdx}/*.{js,jsx,ts,tsx}'],
29+
languageOptions: { parser: tsParser },
30+
rules: {
31+
...mdx.flatCodeBlocks.rules,
32+
'react/jsx-no-undef': 'off',
33+
semi: ['error', 'never'],
34+
quotes: ['error', 'single', { avoidEscape: true }],
35+
'react/jsx-tag-spacing': ['error', { beforeClosing: 'never' }],
36+
},
37+
},
38+
]

0 commit comments

Comments
 (0)