Skip to content

Commit

Permalink
feat(lint): ✨ eslint
Browse files Browse the repository at this point in the history
- 升级eslint9 升级相关配置
  • Loading branch information
jsxiaosi committed Jul 16, 2024
1 parent 09fa9c5 commit 8d08427
Show file tree
Hide file tree
Showing 15 changed files with 3,996 additions and 2,099 deletions.
17 changes: 0 additions & 17 deletions .eslintignore

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion build/vite/plugin/buildOuteInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function getdirsize(dir: string, callback: (fileNumber: number, size: number) =>
readdir(dir, function (err, files) {
//如果是目录
if (err) throw err; //如果遍历目录出错
if (files.length == 0) return callback(0, 0); //如果目录是空的
if (files.length === 0) return callback(0, 0); //如果目录是空的

let count = files.length; //文件数量
for (let i = 0; i < files.length; i++) {
Expand Down
50 changes: 50 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import jsxiaosiConfig from '@jsxiaosi/eslint-config-vue';
import eslintPluginPrettier from 'eslint-plugin-prettier';

export default [
...jsxiaosiConfig,
{
languageOptions: {
globals: {
browser: true,
commonjs: true,
es6: true,
node: true,
},
},
plugins: {
prettier: eslintPluginPrettier,
},
rules: {
'prettier/prettier': [
'error',
{
usePrettierrc: true,
},
],
},
ignores: [
'.vscode/',
'.idea/',
'.husky/',
'*.html',
'*.md',
'*.woff',
'*.ttf',
'*.sh',
'bin/',
'dist/',
'docs/',
'public/',
'discard/',
'Dockerfile',
'node_modules/',
],
},
];

// import antfu from '@antfu/eslint-config'

// export default antfu({
// vue:true
// })
4 changes: 2 additions & 2 deletions mock/account.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ export default defineFakeRoute([
method: 'post',
response: ({ body }: { body: Recordable }) => {
const { username, password } = body;
if (username == 'admin' && password == 'admin123') {
if (username === 'admin' && password === 'admin123') {
userInfo.token = genID(16);
return {
data: userInfo,
code: 1,
message: 'ok',
};
} else if (username == 'test' && password == 'test123') {
} else if (username === 'test' && password === 'test123') {
userInfo2.token = genID(16);
return {
data: userInfo2,
Expand Down
4 changes: 2 additions & 2 deletions mock/route.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ export default defineFakeRoute([
method: 'post',
response: ({ body }: { body: Recordable }) => {
const { name } = body;
if (name == 'admin') {
if (name === 'admin') {
return {
data: [...power, ...adminPermissionRouter],
code: 1,
message: 'ok',
};
} else if (name == 'test') {
} else if (name === 'test') {
return {
data: [...power, ...testPermissionRouter],
code: 1,
Expand Down
107 changes: 54 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,40 @@
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@intlify/unplugin-vue-i18n": "^2.0.0",
"@jsxiaosi/utils": "^0.0.18",
"@logicflow/core": "^1.2.18",
"@logicflow/extension": "^1.2.19",
"@vueuse/core": "^10.7.1",
"axios": "^1.6.5",
"commitlint": "18.4.4",
"dayjs": "^1.11.10",
"docx-preview": "^0.3.0",
"echarts": "^5.4.3",
"element-plus": "^2.7.3",
"@intlify/unplugin-vue-i18n": "^4.0.0",
"@jsxiaosi/utils": "^0.0.19",
"@logicflow/core": "^1.2.27",
"@logicflow/extension": "^1.2.27",
"@vueuse/core": "^10.11.0",
"axios": "^1.7.2",
"commitlint": "19.3.0",
"dayjs": "^1.11.11",
"docx-preview": "^0.3.2",
"echarts": "^5.5.1",
"element-plus": "^2.7.6",
"es6-promise": "^4.2.8",
"html2pdf.js": "^0.10.1",
"i18next": "^23.7.16",
"html2pdf.js": "^0.10.2",
"i18next": "^23.11.5",
"intro.js": "^7.2.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"marked": "^11.1.1",
"marked": "^13.0.2",
"mitt": "^3.0.1",
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"path": "^0.12.7",
"pinia": "^2.1.7",
"qs": "^6.11.2",
"sortablejs": "^1.15.1",
"vue": "^3.4.7",
"vue-i18n": "^9.9.0",
"vue-pdf-embed": "^1.2.1",
"vue-router": "^4.2.5",
"vue-types": "^5.1.1",
"qs": "^6.12.2",
"sortablejs": "^1.15.2",
"vue": "^3.4.31",
"vue-i18n": "^9.13.1",
"vue-pdf-embed": "^2.0.4",
"vue-router": "^4.4.0",
"vue-types": "^5.1.2",
"wangeditor": "^4.7.15"
},
"devDependencies": {
"@antfu/eslint-config": "2.22.0-beta.3",
"@esbuild-kit/cjs-loader": "^2.4.4",
"@jsxiaosi/commitlint-config": "^0.0.21",
"@jsxiaosi/eslint-config-prettier": "^0.0.21",
Expand All @@ -84,53 +85,53 @@
"@types/mockjs": "^1.0.10",
"@types/node": "*",
"@types/nprogress": "^0.2.3",
"@types/qs": "^6.9.11",
"@types/sortablejs": "^1.15.7",
"@vitejs/plugin-vue": "^5.0.2",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"@vue/test-utils": "^2.4.3",
"autoprefixer": "^10.4.16",
"conventional-changelog-cli": "^4.1.0",
"@types/qs": "^6.9.15",
"@types/sortablejs": "^1.15.8",
"@vitejs/plugin-vue": "^5.0.5",
"@vitejs/plugin-vue-jsx": "^4.0.0",
"@vue/test-utils": "^2.4.6",
"autoprefixer": "^10.4.19",
"conventional-changelog-cli": "^5.0.0",
"cross-env": "^7.0.3",
"czg": "^1.8.0",
"czg": "^1.9.3",
"echarts-wordcloud": "^2.1.0",
"eslint": "^8.56.0",
"eslint": "^9.4.0",
"http-server": "^14.1.1",
"husky": "^8.0.3",
"jsdom": "^23.2.0",
"husky": "^9.0.11",
"jsdom": "^24.1.0",
"kolorist": "^1.8.0",
"lint-staged": "^15.2.0",
"postcss": "^8.4.33",
"postcss-html": "^1.5.0",
"postcss-import": "^16.0.0",
"lint-staged": "^15.2.7",
"postcss": "^8.4.39",
"postcss-html": "^1.7.0",
"postcss-import": "^16.1.0",
"postcss-scss": "^4.0.9",
"prettier": "^3.1.1",
"pretty-quick": "^3.1.3",
"prettier": "^3.3.2",
"pretty-quick": "^4.0.0",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.69.7",
"stylelint": "^16.1.0",
"sass": "^1.77.6",
"stylelint": "^16.6.1",
"stylelint-config-property-sort-order-smacss": "^10.0.0",
"stylelint-config-recommended": "^14.0.0",
"stylelint-config-recommended": "^14.0.1",
"stylelint-config-recommended-scss": "^14.0.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-config-standard-scss": "^13.0.0",
"stylelint-config-standard": "^36.0.1",
"stylelint-config-standard-scss": "^13.1.0",
"stylelint-order": "^6.0.4",
"stylelint-scss": "^6.0.0",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3",
"stylelint-scss": "^6.3.2",
"tailwindcss": "^3.4.4",
"typescript": "^5.5.3",
"unplugin-element-plus": "^0.8.0",
"vite": "^5.0.11",
"vite": "^5.3.3",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-fake-server": "^2.1.0",
"vite-plugin-fake-server": "^2.1.1",
"vite-plugin-imagemin": "^0.6.1",
"vite-plugin-inspect": "^0.8.1",
"vite-plugin-linter": "^2.0.7",
"vite-plugin-pwa": "^0.17.4",
"vite-plugin-inspect": "^0.8.4",
"vite-plugin-linter": "^2.1.1",
"vite-plugin-pwa": "^0.20.0",
"vite-plugin-style-import": "^2.0.0",
"vite-plugin-svg-icons": "^2.0.1",
"vitest": "^1.1.3",
"vue-tsc": "^1.8.27",
"vitest": "^1.6.0",
"vue-tsc": "^2.0.26",
"xlsx": "^0.18.5"
},
"pnpm": {
Expand Down
Loading

0 comments on commit 8d08427

Please sign in to comment.