简体   繁体   中英

getting scss errors. how can i solve it?

Having these kinds of errors while running the react app. 在此处输入图像描述

package.json file:->

"lint-staged": {
"linters": {
  "src/**/*.{js,jsx}": [
    "eslint --fix",
    "git add"
  ],
  "src/**/*.scss": [
    "stylelint --fix",
    "git add"
  ]
},
"ignore": [
  "**/dist/*.min.js"
]

}

how can we avoid these errors? Do I need to do any changes?

That's the expected behaviour. Stylelint is flagging violations where your SCSS deviates from the rules defined in your configuration object.

As these are mostly stylistic violations, stylelint can automatically fix the majority of them for you using:

npx stylelint "src/**/*.scss" --fix

The 'Unexpected unit "em" for property "padding"' violation is not stylistic. You'll need to look at the options for the declaration-property-unit-whitelist rule in your configuration object to see what units are allowed for the padding property.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM