mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-01-10 00:09:12 +08:00
chore: upgrade ESLint 9
This commit is contained in:
parent
261d63f683
commit
dabd9947bf
@ -1,3 +0,0 @@
|
||||
dist
|
||||
coverage
|
||||
node_modules
|
@ -1,60 +0,0 @@
|
||||
const { builtinModules } = require('node:module');
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
es6: true,
|
||||
},
|
||||
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier',
|
||||
],
|
||||
plugins: ['import'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
eqeqeq: ['warn', 'always', { null: 'never' }],
|
||||
'no-debugger': ['error'],
|
||||
'no-empty': ['warn', { allowEmptyCatch: true }],
|
||||
'prefer-const': [
|
||||
'warn',
|
||||
{
|
||||
destructuring: 'all',
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/no-var-requires': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/consistent-type-imports': [
|
||||
'error',
|
||||
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
|
||||
],
|
||||
|
||||
'import/no-nodejs-modules': [
|
||||
'error',
|
||||
{ allow: builtinModules.map((mod) => `node:${mod}`) },
|
||||
],
|
||||
'import/no-duplicates': 'error',
|
||||
'import/order': 'error',
|
||||
'sort-imports': [
|
||||
'error',
|
||||
{
|
||||
ignoreCase: false,
|
||||
ignoreDeclarationSort: true,
|
||||
ignoreMemberSort: false,
|
||||
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
||||
allowSeparatedGroups: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
69
eslint.config.js
Normal file
69
eslint.config.js
Normal file
@ -0,0 +1,69 @@
|
||||
// @ts-check
|
||||
import { builtinModules } from 'node:module';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import importX from 'eslint-plugin-import-x';
|
||||
// @ts-expect-error missing types
|
||||
import eslint from '@eslint/js';
|
||||
// @ts-expect-error missing types
|
||||
import eslintConfigPrettier from 'eslint-config-prettier';
|
||||
|
||||
export default tseslint.config(
|
||||
eslint.configs.recommended,
|
||||
{
|
||||
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
|
||||
extends: [...tseslint.configs.recommended],
|
||||
plugins: {
|
||||
import: importX,
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
eqeqeq: ['warn', 'always', { null: 'never' }],
|
||||
'no-debugger': ['error'],
|
||||
'no-empty': ['warn', { allowEmptyCatch: true }],
|
||||
'prefer-const': [
|
||||
'warn',
|
||||
{
|
||||
destructuring: 'all',
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/no-var-requires': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/consistent-type-imports': [
|
||||
'error',
|
||||
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
|
||||
],
|
||||
|
||||
'import/no-nodejs-modules': [
|
||||
'error',
|
||||
{ allow: builtinModules.map((mod) => `node:${mod}`) },
|
||||
],
|
||||
'import/no-duplicates': 'error',
|
||||
'import/order': 'error',
|
||||
'sort-imports': [
|
||||
'error',
|
||||
{
|
||||
ignoreCase: false,
|
||||
ignoreDeclarationSort: true,
|
||||
ignoreMemberSort: false,
|
||||
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
||||
allowSeparatedGroups: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
eslintConfigPrettier,
|
||||
{
|
||||
ignores: ['**/dist/', '**/coverage/'],
|
||||
}
|
||||
);
|
@ -20,22 +20,24 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/plugin-syntax-typescript": "^7.23.3",
|
||||
"@eslint/js": "^9.3.0",
|
||||
"@rollup/plugin-babel": "^6.0.4",
|
||||
"@types/babel__core": "^7.20.5",
|
||||
"@types/babel__helper-module-imports": "^7.18.3",
|
||||
"@types/babel__helper-plugin-utils": "^7.10.3",
|
||||
"@types/node": "^20.11.16",
|
||||
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
||||
"@vitest/coverage-v8": "^1.2.2",
|
||||
"@vue/babel-plugin-jsx": "workspace:*",
|
||||
"bumpp": "^9.3.0",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint": "^9.3.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-import-x": "^0.5.0",
|
||||
"jsdom": "^24.0.0",
|
||||
"prettier": "^3.2.5",
|
||||
"tslib": "^2.6.2",
|
||||
"tsup": "^8.0.1",
|
||||
"typescript": "^5.3.3",
|
||||
"typescript-eslint": "^7.10.0",
|
||||
"vite": "^5.0.12",
|
||||
"vitest": "^1.2.2"
|
||||
}
|
||||
|
@ -482,11 +482,8 @@ test('reassign variable as component should work', () => {
|
||||
},
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
const _a2 = 2;
|
||||
a = _a2;
|
||||
/* eslint-enable */
|
||||
|
||||
a = <A>{a}</A>;
|
||||
|
||||
const wrapper = mount({
|
||||
|
1847
pnpm-lock.yaml
generated
1847
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user