chore(config): 更新 ESLint 配置文件
- 删除旧的 `eslint.config.js` 文件 - 新增 `eslint.config.mjs` 文件 - 更新忽略规则,增加对新目录的忽略 - 扩展支持 JSX 文件 - 合并并优化规则配置
This commit is contained in:
@@ -1,22 +0,0 @@
|
|||||||
import js from '@eslint/js';
|
|
||||||
import solid from 'eslint-plugin-solid';
|
|
||||||
import globals from 'globals';
|
|
||||||
import tseslint from 'typescript-eslint';
|
|
||||||
|
|
||||||
export default tseslint.config(
|
|
||||||
{ ignores: ['dist'] },
|
|
||||||
{
|
|
||||||
extends: [js.configs.recommended, ...tseslint.configs.recommended, 'plugin:solid/typescript'],
|
|
||||||
files: ['**/*.{ts,tsx}'],
|
|
||||||
languageOptions: {
|
|
||||||
ecmaVersion: 2020,
|
|
||||||
globals: globals.browser,
|
|
||||||
},
|
|
||||||
plugins: { solid },
|
|
||||||
rules: {
|
|
||||||
'solid/reactivity': 'warn',
|
|
||||||
'solid/no-destructure': 'warn',
|
|
||||||
'solid/jsx-no-undef': 'error',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
);
|
|
35
eslint.config.mjs
Normal file
35
eslint.config.mjs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import js from '@eslint/js';
|
||||||
|
|
||||||
|
import solid from 'eslint-plugin-solid';
|
||||||
|
import globals from 'globals';
|
||||||
|
import tseslint from 'typescript-eslint';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
ignores: ['node_modules/', 'dist/', 'dist-ssr/', '.output/', '*.config.js'],
|
||||||
|
},
|
||||||
|
js.configs.recommended,
|
||||||
|
...tseslint.configs.recommended,
|
||||||
|
{
|
||||||
|
files: ['**/*.{ts,tsx,jsx}'],
|
||||||
|
plugins: {
|
||||||
|
solid,
|
||||||
|
},
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
},
|
||||||
|
parserOptions: {
|
||||||
|
ecmaFeatures: {
|
||||||
|
jsx: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...solid.configs.typescript.rules,
|
||||||
|
'solid/reactivity': 'warn',
|
||||||
|
'solid/no-destructure': 'warn',
|
||||||
|
'solid/jsx-no-undef': 'error',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
Reference in New Issue
Block a user