|
1 | | -import tsParser from '@typescript-eslint/parser' |
2 | 1 | import { configs } from 'eslint-plugin-devup' |
3 | 2 | import jsonc from 'eslint-plugin-jsonc' |
4 | 3 | import * as mdx from 'eslint-plugin-mdx' |
5 | | -import jsonParser from 'jsonc-eslint-parser' |
| 4 | +import globals from 'globals' |
6 | 5 |
|
7 | 6 | export default [ |
| 7 | + // eslint-plugin-devup |
8 | 8 | ...configs.recommended, |
| 9 | + // eslint-plugin-jsonc |
| 10 | + ...jsonc.configs['flat/recommended-with-json'], |
| 11 | + ...jsonc.configs['flat/recommended-with-jsonc'], |
| 12 | + // globals (node, browser, builtin) |
9 | 13 | { |
10 | | - files: ['**/*.{json,json5,jsonc}'], |
11 | | - languageOptions: { parser: jsonParser }, |
12 | | - plugins: { jsonc }, |
| 14 | + files: ['**/*.{js,mjs,cjs}'], |
| 15 | + languageOptions: { |
| 16 | + globals: { |
| 17 | + ...globals.browser, |
| 18 | + ...globals.node, |
| 19 | + ...globals.builtin, |
| 20 | + }, |
| 21 | + }, |
| 22 | + rules: { |
| 23 | + // js require import allowed |
| 24 | + '@typescript-eslint/no-require-imports': 'off', |
| 25 | + }, |
| 26 | + }, |
| 27 | + // benchmark no console rules |
| 28 | + { |
| 29 | + files: ['benchmark.js'], |
| 30 | + rules: { |
| 31 | + 'no-console': [ |
| 32 | + 'error', |
| 33 | + { |
| 34 | + allow: ['info', 'debug', 'warn', 'error', 'profile', 'profileEnd'], |
| 35 | + }, |
| 36 | + ], |
| 37 | + }, |
| 38 | + }, |
| 39 | + // create-style-context.mjs no children prop |
| 40 | + { |
| 41 | + files: ['**/*.mjs'], |
13 | 42 | rules: { |
14 | | - 'prettier/prettier': 'off', |
15 | | - 'eol-last': ['error', 'never'], |
16 | | - 'no-multiple-empty-lines': ['error', { max: 0, maxEOF: 0 }], |
| 43 | + 'react/no-children-prop': 'off', |
17 | 44 | }, |
18 | 45 | }, |
| 46 | + // md, mdx rules |
19 | 47 | { |
20 | 48 | ...mdx.flat, |
21 | 49 | files: ['**/*.{md,mdx}'], |
22 | 50 | processor: mdx.createRemarkProcessor({ |
23 | 51 | lintCodeBlocks: true, |
24 | 52 | }), |
25 | 53 | }, |
| 54 | + // md, mdx code blocks rules |
26 | 55 | { |
27 | 56 | ...mdx.flatCodeBlocks, |
28 | 57 | files: ['**/*.{md,mdx}/*.{js,jsx,ts,tsx}'], |
29 | | - languageOptions: { parser: tsParser }, |
30 | 58 | rules: { |
31 | 59 | ...mdx.flatCodeBlocks.rules, |
32 | 60 | 'react/jsx-no-undef': 'off', |
33 | | - semi: ['error', 'never'], |
34 | | - quotes: ['error', 'single', { avoidEscape: true }], |
35 | 61 | 'react/jsx-tag-spacing': ['error', { beforeClosing: 'never' }], |
36 | 62 | }, |
37 | 63 | }, |
|
0 commit comments