@ acuris/eslint-config
@ acuris/eslint-config
共享 Acuris eslint 配置和代码质量工具.
初始化您的项目
在您的工程文件夹中运行此命令是最简单和首选的
npx @acuris/eslint-config@latest --init
这将启动一个交互式初始化脚本,该脚本将设置您需要的一切,包括软件包的安装.
如果您在工程初始化后安装了新软件包( 例如, jest 或打字符), 您可能想要运行 acuris-eslint --init 再次添加额外的依赖关系.
更新@ acuris/eslint- config
一旦安装, 您可以更新到最新版本( 包括依赖) 执行
acuris-eslint --init
插入您的整个工程
您可以将您的整个工程插入运行
acuris-eslint
您可以修改您整个工程运行的格式
acuris-eslint --fix
您也可以通过 glob 路径、 文件夹或 sinngle 文件到 lint .
acuris-eslint hello.js myFolder
在可用选项和命令的列表中为 morry 帮助运行
acuris-eslint --help
注意: 如果 PATH 无法在 node modules/.bin 中解析节点二进制, 您可以预置所有命令 npx。 。 。 .
项目配置
您可以添加 acuris-eslint 以通过额外选项.
{
name: 'my-package',
// ...
"acuris-eslint": {
/**
* Override patterns used to apply different eslint rules.
*/
filePatterns: {
/** patterns that should be prettified when running --fix, but not validated using eslint parsers */
prettier: string[] | { [pattern: string]: boolean },
/** mjs module patterns */
mjs: string[] | { [pattern: string]: boolean },
/** .ts, .tsx patterns */
typescript: string[] | { [pattern: string]: boolean },
/** .d.ts patterns */
typescriptDefinition: string[] | { [pattern: string]: boolean },
/** binary script patterns */
bin: string[] | { [pattern: string]: boolean },
/** scripts pattern, similar to bin*/
scripts: string[] | { [pattern: string]: boolean },
/** server side code patterns */
server: string[] | { [pattern: string]: boolean },
/** dist folder patterns (less stringent rules) */
dist: string[] | { [pattern: string]: boolean },
/** test files patterns */
tests: string[] | { [pattern: string]: boolean }
},
/**
* The path of the eslintrc file to load when running acuris-eslint command
* Can be overridden by command line option '--config'
*/
eslintrc: string,
/**
* Enables or disable eslint cache when running acuris-eslint command.
* Can be overridden by command line option '--cache' or '--no-cache'
*/
eslintCache: boolean,
/**
* Changes the path of eslint cache when running acuris-eslint command.
* By default is `.eslintcache`
* Can be overridden by command line option '--cache-location'
*/
eslintCacheLocation: string,
/**
* The warnigns and errors output format when running acuris-eslint command.
* By default is `stylish`.
* Can be overridden by command line option '--format'
*/
eslintOutputFormat: string,
/**
* The react version to use for react eslint plugin.
*/
reactVersion: string,
/**
* A custom path for the `tsconfig.json` configuration when using typescript.
* By default, the first tsconfig.json in the current folder or parent folders is used.
*/
tsConfigPath: string,
/**
* The list of packages to disable when initializing a project or running eslint.
* For example, ['typescript', 'react', 'eslint-plugin-jsx-a11y'] disables typescript, react and jsx-a11y.
*
*/
ignoredPackages: string[] | { [packageName: string]: boolean },
/**
* Additional node_modules paths to use when resolving eslint plugins or configurations.
*/
nodeResolvePaths: string[] | { [path: string]: boolean },
}
}
更改日志
- 页:1
- acuris-slint现在支持对所有支持的文件进行预发,而不仅仅是JS和TS. 使用线工来使用免费的CPU来进行先发制人.
- 通过覆盖加载扩展
- 添加对. files 的支持, 现在它们被内嵌
- 选项 --lint-staged和 --ignore-unknown-extensions 将在处理文件列表时跳过不支持扩展名的文件.
- 7.0.0,打字机3.9
- 修复时的性能改进和同步写入