Skip to content

Commit

Permalink
chore: lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Nov 10, 2023
1 parent b7d74d4 commit 699899d
Show file tree
Hide file tree
Showing 178 changed files with 2,522 additions and 2,746 deletions.
150 changes: 5 additions & 145 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,6 @@
{
"typescript.tsdk": "./node_modules/typescript/lib",
"volar.tsPlugin": true,
"volar.tsPluginStatus": false,
"npm.packageManager": "pnpm",
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"files.eol": "\n",
"search.exclude": {
"**/node_modules": true,
"**/*.log": true,
"**/*.log*": true,
"**/bower_components": true,
"**/dist": true,
"**/elehukouben": true,
"**/.git": true,
"**/.gitignore": true,
"**/.svn": true,
"**/.DS_Store": true,
"**/.idea": true,
"**/.vscode": false,
"**/yarn.lock": true,
"**/tmp": true,
"out": true,
"dist": true,
"node_modules": true,
"CHANGELOG.md": true,
"examples": true,
"res": true,
"screenshots": true,
"yarn-error.log": true,
"**/.yarn": true
},
"files.exclude": {
"**/.cache": true,
"**/.editorconfig": true,
"**/.eslintcache": true,
"**/bower_components": true,
"**/.idea": true,
"**/tmp": true,
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/.vscode/**": true,
"**/node_modules/**": true,
"**/tmp/**": true,
"**/bower_components/**": true,
"**/dist/**": true,
"**/yarn.lock": true
},
"stylelint.enable": true,
"stylelint.validate": [
"css",
Expand All @@ -63,46 +10,20 @@
"vue",
"sass"
],
"path-intellisense.mappings": {
"/@/": "${workspaceRoot}/src"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
},
"editor.formatOnSave": false,
"editor.formatOnSave": true,
"[vue]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
}
},
"i18n-ally.localesPaths": [
"src/locales/lang"
"apps/admin/src/locales/lang"
],
"i18n-ally.keystyle": "nested",
"i18n-ally.sortKeys": true,
Expand All @@ -117,68 +38,7 @@
"vue",
"react"
],
"cSpell.words": [
"vben",
"browserslist",
"tailwindcss",
"esnext",
"antv",
"tinymce",
"qrcode",
"sider",
"pinia",
"sider",
"nprogress",
"INTLIFY",
"stylelint",
"esno",
"vitejs",
"sortablejs",
"mockjs",
"codemirror",
"iconify",
"commitlint",
"vditor",
"echarts",
"cropperjs",
"logicflow",
"vueuse",
"zxcvbn",
"lintstagedrc",
"brotli",
"tailwindcss",
"sider",
"pnpm",
"antd"
],
"MicroPython.executeButton": [
{
"text": "",
"tooltip": "运行",
"alignment": "left",
"command": "extension.executeFile",
"priority": 3.5
}
],
"MicroPython.syncButton": [
{
"text": "$(sync)",
"tooltip": "同步",
"alignment": "left",
"command": "extension.execute",
"priority": 4
}
],
// 控制相关文件嵌套展示
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
"*.ts": "$(capture).test.ts, $(capture).test.tsx",
"*.tsx": "$(capture).test.ts, $(capture).test.tsx",
"*.env": "$(capture).env.*",
"CHANGELOG.md": "CHANGELOG*",
"package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,README*,.npmrc,.browserslistrc",
".eslintrc.js": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.js,.prettierrc.js,.stylelintrc.js"
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"terminal.integrated.scrollback": 10000
}
82 changes: 38 additions & 44 deletions apps/api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,73 +1,67 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
extraFileExtensions: ['.json']
tsconfigRootDir: __dirname,
},
root: true,
env: {
node: true,
jest: true,
},
plugins: ['@typescript-eslint', 'import', 'unused-imports'],
plugins: ['@typescript-eslint', 'unused-imports'],
extends: [
'airbnb-base',
'airbnb-typescript/base',

'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
'prettier',
'plugin:import/recommended',
],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/naming-convention': 'off',

"max-classes-per-file": "off",
"class-methods-use-this": "off",
"no-param-reassign": "off",

'unused-imports/no-unused-imports': 1,
'unused-imports/no-unused-vars': [
'error',
{
vars: 'all',
args: 'none',
ignoreRestSiblings: true,
},
],

'import/extensions': 0,
'import/prefer-default-export': 0,
'import/no-cycle': 0,
'import/no-import-module-exports': 0,

// import
'import/named': 'off',
'import/first': 'error',
'import/no-mutable-exports': 'error',
'import/no-unresolved': 'off',
'import/no-absolute-path': 'off',
'import/no-default-export': 'off',
'import/no-cycle': 'off',
'import/no-import-module-exports': 'off',
'import/order': [
'error',
{
pathGroups: [
'pathGroups': [
{
pattern: '@/**',
group: 'external',
position: 'after',
},
],
alphabetize: { order: 'asc', caseInsensitive: false },
'alphabetize': { order: 'asc', caseInsensitive: false },
'newlines-between': 'always-and-inside-groups',
warnOnUnassignedImports: true,
'warnOnUnassignedImports': true,
},
],

'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],

'no-restricted-syntax': 'off',
'no-await-in-loop': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/naming-convention': 'off',

'radix': 'off',
'no-bitwise': 'off'
'@typescript-eslint/no-unused-vars': 'off',
},
};
}
8 changes: 3 additions & 5 deletions apps/api/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"quoteProps": "consistent",
"bracketSpacing": true,
"arrowParens": "always",
"trailingComma": "all",
"nsertPragma": false,
"endOfLine": "auto"
"trailingComma": "all"
}
40 changes: 20 additions & 20 deletions apps/api/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { Module } from '@nestjs/common';

import { ConfigModule } from '@nestjs/config';
import { APP_FILTER, APP_GUARD } from '@nestjs/core';

import * as config from '@/config';
import { SharedModule } from '@/shared/shared.module';

import { AllExceptionsFilter } from './common/filters/any-exception.filter';

import { TodoModule } from './modules/todo/todo.module';
import { AuthModule } from './modules/auth/auth.module';
import { JwtAuthGuard } from './modules/auth/guards/jwt-auth.guard';
import { RbacGuard } from './modules/auth/guards/rbac.guard';
import { HealthModule } from './modules/health/health.module';
import { SocketModule } from './modules/socket/socket.module';
import { SystemModule } from './modules/system/system.module';
import { TasksModule } from './modules/tasks/tasks.module';
import { ToolsModule } from './modules/tools/tools.module';
import { DatabaseModule } from './shared/database/database.module';
import { Module } from '@nestjs/common'

import { ConfigModule } from '@nestjs/config'
import { APP_FILTER, APP_GUARD } from '@nestjs/core'

import * as config from '@/config'
import { SharedModule } from '@/shared/shared.module'

import { AllExceptionsFilter } from './common/filters/any-exception.filter'

import { AuthModule } from './modules/auth/auth.module'
import { JwtAuthGuard } from './modules/auth/guards/jwt-auth.guard'
import { RbacGuard } from './modules/auth/guards/rbac.guard'
import { HealthModule } from './modules/health/health.module'
import { SocketModule } from './modules/socket/socket.module'
import { SystemModule } from './modules/system/system.module'
import { TasksModule } from './modules/tasks/tasks.module'
import { TodoModule } from './modules/todo/todo.module'
import { ToolsModule } from './modules/tools/tools.module'
import { DatabaseModule } from './shared/database/database.module'

@Module({
imports: [
Expand Down
Loading

0 comments on commit 699899d

Please sign in to comment.