鉴于以下内容package.json:
"stylelint": {
"extends": "stylelint-config-standard",
"rules": {
"string-quotes": "single",
"block-no-empty": false,
"indentation": 2
}
}
我无法弄清楚如何覆盖block-no-empty.如果我将其设置为false,我会收到错误:
Invalid Option: Unexpected option value "false" for rule "block-no-empty"
我错过了某种覆盖语法吗?
[stylelint] Unexpected missing end-of-source newline (no-missing-end-of-source-newline)
[stylelint] Expected "backgroundColor" to be "backgroundcolor" (value-keyword-case)
[stylelint] Expected a trailing semicolon (declaration-block-trailing-semicolon)
Run Code Online (Sandbox Code Playgroud)
如何阻止VS Code Styleint扩展报告此类内容?你可以看到它并不是特别有用:P
更新:
为了澄清,我有一个.stylelintrc配置文件,我的规则就像我想要的那样,但是我希望它能够使我的样式而不是我的JavaScript.该扩展的描述说:
stylelint自动验证具有以下语言标识符的文档:
......并且javascriptreact是其中一种语言标识符.我想知道如何阻止扩展验证javascriptreact文件.
ESLint和Stylelint是否在项目上做相同的事情(掉毛),还是专门用于某些文件?我可以在同一项目中使用它们吗?在同一项目中通常使用不止一个短绒是一个好主意吗?
我在中的WebStorm(2018.2.3)中配置了stylelint Settings -> Languages and Frameworks -> Stylesheets -> Stylelint。我的根目录中有.stylelintrc。
现在,stylelint成功地在我的css文件中强调了错误。但是有没有办法在WebStorm帮助下修复它们(--fix在控制台中没有运行命令)?
我有问题.我跑的时候:npm run stylelint.我的cmd显示通知
moutain-mental-website@0.0.0 stylelint E:\Mountain_Mental
> stylelint 'public/css/**/*.scss'
Error: Files glob patterns specified did not match any files
at E:\Mountain_Mental\node_modules\stylelint\dist\standalone.js:83:19
Run Code Online (Sandbox Code Playgroud) 我刚刚安装STYLELINT并按照文档进行操作,但遇到了以下问题:
$ npx stylelint --config ./stylelintrc './**/*.tsx'
Error: No files matching the pattern "'./src/**/*.tsx'" were found.
at standalone (C:\Users\thiag\OneDrive\Documentos\PROJETOS\sugar\node_modules\stylelint\lib\standalone.js:273:43)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.
Run Code Online (Sandbox Code Playgroud)
这是我的层次结构:
这是我的代码.stylelintrc:
{
"processors": ["stylelint-processor-styled-components"],
"extends": ["stylelint-config-recommended", "stylelint-config-styled-components"],
"customSyntax": "postcss-scss",
"rules": { // BAR }
}
Run Code Online (Sandbox Code Playgroud)
封装代码:
{
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"stylelint:check": "stylelint-config-prettier-check",
"stylelint:css": "npx stylelint './**/*.{tsx, ts}'",
"prepare": "husky …Run Code Online (Sandbox Code Playgroud) 我使用 Sass(scss) 作为我的项目的 css 预处理器。但是当我运行sass 编译的stylelint文件时.css,它返回很多错误,您无法直接在.css文件中修复这些错误,因为这些文件是由 sass 编译的。sass 重新编译 css 文件后,您更改的任何内容都将丢失。
我使用了各种 sass linting 选项,例如sass-lint和 ,sass-lint-auto-fix但是这些选项虽然有用,但并没有解决文件中的问题.css。
stylelint还不断将各种 sass @-rules 标记@mixin为@include意外和未知的 at-rules。
欢迎任何建议或想法。谢谢。