spec
spec copied to clipboard
:hatching_chick: easy to use eslint/stylelint/tslint/prettier/...
See https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-redeclare.md.
* 增加 `eslint-plugin-prettier` * 设置错误级别为警告 `"prettier/prettier": "warn"` * 使用 prettier 规则更新仓库代码 * prettier 可能会存在用户不希望修改的部分,比如:  原逻辑开发者刻意分层,prettier 后复杂判断可读性降低。 不希望修复改的部分可通过 注释 或 关闭 "prettier/prettier": "off"
```bash $ yarn add eslint-plugin-prettier eslint-config-prettier -D ``` ```ts const { getESLintConfig } = require('@iceworks/spec'); module.exports = getESLintConfig('react-ts', { extends: ['plugin:prettier/recommended'], }); ``` 这样可以检测到哪些代码的格式化是有问题的, 并在vsc报红, 并且可以通过eslint修复