VijayT
VijayT

Reputation: 27

getting scss errors. how can i solve it?

Having these kinds of errors while running the react app. enter image description here

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?

Upvotes: 1

Views: 726

Answers (1)

jeddy3
jeddy3

Reputation: 3959

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.

Upvotes: 1

Related Questions