Intellij idea prettier与Intellij Idea和NPM的集成
我想要实现的目标Intellij idea prettier与Intellij Idea和NPM的集成,intellij-idea,eslint,tslint,prettier,stylelint,Intellij Idea,Eslint,Tslint,Prettier,Stylelint,我想要实现的目标 Intellij-通过红色下划线显示错误 通过NPM验证格式化 通过保存自动格式化 将printWidth覆盖为140 与stylelint、tslint和文件监视程序集成 我所做的 stylelint.config.js const regex = { pascal: "[A-Z][a-z]+[a-zA-Z]*", camel: "[a-z]+[a-zA-Z]*" }; const componentElementModifier = `\\.${regex.pas
const regex = {
pascal: "[A-Z][a-z]+[a-zA-Z]*",
camel: "[a-z]+[a-zA-Z]*"
};
const componentElementModifier = `\\.${regex.pascal}(__${regex.camel}(_${regex.camel})?)?`;
const componentModifier = `\\.${regex.pascal}_${regex.camel}`;
const bemMix = `\\.${regex.pascal}__${regex.pascal}`;
module.exports = {
plugins: ["stylelint-prettier", "stylelint-selector-bem-pattern"],
extends: ["stylelint-prettier/recommended"],
rules: {
"prettier/prettier": true,
"plugin/selector-bem-pattern": {
componentName: regex.pascal,
implicitComponents: true,
componentSelectors: {
initial: `^(${componentElementModifier})$|^(${bemMix})$|^(${componentModifier})$`
}
}
}
};
tslint.json
{
"extends": [
"tslint:latest",
"tslint-react",
"tslint-plugin-prettier",
"tslint-config-prettier"
],
"rules": {
"object-literal-sort-keys": false,
"prettier": true,
"no-default-export": true
},
"linterOptions": {
"exclude": ["**/*.less.d.ts"]
}
}
Intellij Idea-文件监视程序配置
Intellij Idea-TSlint配置
Intellij Idea-类型脚本配置
packge.json-stylelint config+runner
我的问题是什么
tslint--fix
和stylelint--fix
命令的package.json
,则可以将它们配置为文件监视程序