@rock-hammer/eslint-config
v0.0.26
Published
ESlint config for rock-hammer
Downloads
11
Readme
@rock-hammer/eslint-config
安装
需要额外安装:
- eslint
- @antfu/eslint-config
- eslint-plugin-sort-keys-fix
pnpm add eslint @antfu/eslint-config @rock-hammer/eslint-config eslint-plugin-sort-keys-fix -D
使用
module
如果在 package.json 中声明了 "type": "module"
// eslint.config.js
import antfu from '@antfu/eslint-config'
import config from '@rock-hammer/eslint-config'
import sortKeysFix from 'eslint-plugin-sort-keys-fix'
export default [
...antfu(),
...config(),
{
plugins: {
'sort-keys': sortKeysFix,
},
rules: {
'sort-keys/sort-keys-fix': 'warn',
},
},
]
cjs
例如在 nest.js 项目中
// eslint.config.js
const antfu = require('@antfu/eslint-config').default
const config = require('@rock-hammer/eslint-config')
module.exports = [
...antfu(),
...config(),
{
rules: {
'ts/consistent-type-imports': 'off',
},
},
]