@borgar/eslint-config
我对我的代码应该怎么看有意见 这是对这些的捕捉.
看这个 实例.js 来感受一下密码的模样.
安装中
把它拉进你的包里 这样:
npm install --save-dev eslint @eslint/js globals typescript-eslint @borgar/eslint-config
然后添加 eslint.config.js 文件 :
import borgarLint from '@borgar/eslint-config';
import eslint from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
files: [
'**/*.js',
'**/*.ts',
'**/*.mjs'
],
ignores: [
'dist/*'
],
languageOptions: {
globals: { ...globals.browser },
parserOptions: { projectService: { allowDefaultProject: [] } }
}
},
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
tseslint.configs.stylisticTypeChecked,
borgarLint.config.recommended,
borgarLint.config.stylistic({
commaDangle: true,
singleBlocks: true,
lineLength: 120
}),
);