mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 1.0 beta
This commit is contained in:
6
packages/eslint-config/configs/base.js
Normal file
6
packages/eslint-config/configs/base.js
Normal file
@ -0,0 +1,6 @@
|
||||
/**
|
||||
* @type {import('eslint').ESLint.ConfigData}
|
||||
*/
|
||||
module.exports = {
|
||||
extends: [require.resolve('./ts.js'), require.resolve('./prettier.js')]
|
||||
};
|
44
packages/eslint-config/configs/js.js
Normal file
44
packages/eslint-config/configs/js.js
Normal file
@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @type {import('eslint').ESLint.ConfigData}
|
||||
*/
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
commonjs: true,
|
||||
es2024: true
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2024,
|
||||
ecmaFeatures: {
|
||||
jsx: true
|
||||
},
|
||||
sourceType: 'module'
|
||||
},
|
||||
ignorePatterns: [
|
||||
'node_modules',
|
||||
'*.min.*',
|
||||
'CHANGELOG.md',
|
||||
'dist',
|
||||
'LICENSE*',
|
||||
'output',
|
||||
'coverage',
|
||||
'public',
|
||||
'temp',
|
||||
'package-lock.json',
|
||||
'pnpm-lock.yaml',
|
||||
'yarn.lock',
|
||||
'__snapshots__',
|
||||
'!.github',
|
||||
'!.vitepress',
|
||||
'!.vscode'
|
||||
],
|
||||
plugins: ['n', 'promise'],
|
||||
extends: [require.resolve('../rules/all.js'), 'plugin:import/recommended'],
|
||||
rules: {
|
||||
// import
|
||||
'import/no-mutable-exports': 'error',
|
||||
'import/no-named-as-default': 'off'
|
||||
}
|
||||
};
|
11
packages/eslint-config/configs/prettier.js
Normal file
11
packages/eslint-config/configs/prettier.js
Normal file
@ -0,0 +1,11 @@
|
||||
const prettierRules = require('../rules/prettier');
|
||||
|
||||
/**
|
||||
* @type {import('eslint').ESLint.ConfigData}
|
||||
*/
|
||||
module.exports = {
|
||||
extends: ['plugin:prettier/recommended'],
|
||||
rules: {
|
||||
'prettier/prettier': ['error', prettierRules]
|
||||
}
|
||||
};
|
61
packages/eslint-config/configs/ts.js
Normal file
61
packages/eslint-config/configs/ts.js
Normal file
@ -0,0 +1,61 @@
|
||||
/**
|
||||
* @type {import('eslint').ESLint.ConfigData}
|
||||
*/
|
||||
module.exports = {
|
||||
plugins: ['@typescript-eslint'],
|
||||
extends: [require.resolve('./js.js'), 'plugin:import/typescript', 'plugin:@typescript-eslint/recommended'],
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
typescript: {
|
||||
project: ['tsconfig.json', 'packages/*/tsconfig.json', 'examples/*/tsconfig.json', 'docs/*/tsconfig.json']
|
||||
}
|
||||
}
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts', '*.tsx', '*.mts', '*.cts'],
|
||||
parser: '@typescript-eslint/parser'
|
||||
},
|
||||
{
|
||||
files: ['*.js', '*.mjs', '*.cjs', '*.cts'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-var-requires': 'off'
|
||||
}
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
// TS
|
||||
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', disallowTypeAnnotations: false }],
|
||||
'@typescript-eslint/no-empty-interface': [
|
||||
'error',
|
||||
{
|
||||
allowSingleExtends: true
|
||||
}
|
||||
],
|
||||
|
||||
// Override JS
|
||||
'no-redeclare': 'off',
|
||||
'@typescript-eslint/no-redeclare': 'error',
|
||||
'no-unused-vars': 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
vars: 'all',
|
||||
args: 'all',
|
||||
ignoreRestSiblings: false,
|
||||
varsIgnorePattern: '^_',
|
||||
argsIgnorePattern: '^_'
|
||||
}
|
||||
],
|
||||
'no-use-before-define': 'off',
|
||||
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false, variables: true }],
|
||||
'no-shadow': 'off',
|
||||
'@typescript-eslint/no-shadow': 'error',
|
||||
|
||||
// off
|
||||
'@typescript-eslint/consistent-type-definitions': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off'
|
||||
}
|
||||
};
|
30
packages/eslint-config/configs/vue.js
Normal file
30
packages/eslint-config/configs/vue.js
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @type {import('eslint').ESLint.ConfigData}
|
||||
*/
|
||||
module.exports = {
|
||||
extends: ['plugin:vue/vue3-recommended', require.resolve('./base.js')],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.vue'],
|
||||
parser: 'vue-eslint-parser',
|
||||
parserOptions: {
|
||||
parser: {
|
||||
js: 'espree',
|
||||
jsx: 'espree',
|
||||
ts: '@typescript-eslint/parser',
|
||||
tsx: '@typescript-eslint/parser'
|
||||
},
|
||||
extraFileExtensions: ['.vue'],
|
||||
ecmaFeatures: {
|
||||
jsx: true
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'no-undef': 'off' // TS will check un declared variables, if the script code is is in a .vue file, this rule should not disabled
|
||||
}
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
'vue/multi-word-component-names': 'off'
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user