Questions tagged [stylelint]

A modern CSS linter that helps you enforce consistent conventions and avoid errors in your stylesheets.

Links

284 questions
18
votes
3 answers

How to run several commands on precommit with husky npm module?

I use husky to check JS before commit. In my package.json i have "scripts": { "lintStyles": "stylelint app/**/*.scss", "fixStylesLinting": "stylelint app/**/*.scss --fix", "lintJS": "eslint app/**/*.js", "fixJSLinting": "eslint…
Rantiev
  • 2,121
  • 2
  • 32
  • 56
16
votes
2 answers

StyleLint - Ignore specific folders and files

I'm using StyleLint with Webpack. My current Webpack configuration is: module.exports.styleLint = (isProd = false) => { const options = { configFile: './.stylelintrc.json', files: '**/*.less', format: 'less', failOnError: false, …
Guy
  • 1,547
  • 1
  • 18
  • 29
14
votes
1 answer

No configuration provided for scss file

When i try to npm start, error: No configuration provided for .../main.scss, Error in plugin "gulp-stylelint". Someone help me!
Neo
  • 151
  • 1
  • 1
  • 7
13
votes
2 answers

How to lint for a harry robert's BEM convention with stylelint?

PostCSS BEM Linter plugin needs component definition for each block which is a time consuming thing to do in a legacy project. Is there a way to use stylelint to check for the classes pattern and show error in all stylesheets (.scss in my case) of…
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852
12
votes
3 answers

Vue.js: Invalid options in vue.config.js: "plugins" is not allowed

I have a webpack project and I want to use Stylelint for SCSS linting. I have followed the instructions on the Stylelint website and installed: "stylelint": "^12.0.1", "stylelint-webpack-plugin": "^1.1.2", And then I have put this in…
Bobby
  • 135
  • 1
  • 1
  • 8
12
votes
2 answers

Integrating Stylelint with Vue.js

I'm working on trying to integrate stylelint into my freshly created Vue project. I thought this would be a simple case of using the Stylelint Webpack Plugin but when I run yarn serve, any errors completely freeze it with no output. If I run yarn…
dcr24
  • 374
  • 1
  • 5
  • 11
12
votes
2 answers

Stylelint VScode doesn't work

I want to use the css linter "stylelint" on my VScode text editor. I downloaded the plugin and install it, then I make the "css.validate": false. But i don't have any box that show me error on my CSS files. What can I do ?
alexzerah
  • 174
  • 1
  • 1
  • 11
11
votes
1 answer

how to disable stylelint rules?

I am using stylelints and I have some rules that I want to disable : in less I have to do calc this way top: calc(~'50% + 30px'); but "function-calc-no-invalid" prevent it https://stylelint.io/user-guide/rules/function-calc-no-invalid also, I want…
Bobby
  • 4,372
  • 8
  • 47
  • 103
10
votes
5 answers

How do I set stylelint to fix errors automatically?

stylelint *.css --fix not working as expect. Error reporting works well but a file is not fixed. package.json { "devDependencies": { "stylelint": "^11.1.1", "stylelint-config-recess-order": "^2.0.3" } } .stylelintrc.json { "extends":…
takanopontaro
  • 217
  • 1
  • 2
  • 12
10
votes
2 answers

no-descending-specificity error reported on two different classes

I'm using stylelint with the standard format stylelint-config-standard and I'm encountering this error a lot with my stylesheets: no-descending-specificity An example of where it's happening is when I have CSS like: .footer__social li a…
Cameron
  • 27,963
  • 100
  • 281
  • 483
10
votes
2 answers

Stylelint fix in WebStorm

I configured stylelint in my WebStorm (2018.2.3) in Settings -> Languages and Frameworks -> Stylesheets -> Stylelint. And I have .stylelintrc in my root. Right now stylelint successfully underlines errors in my css file. But is there a way to fix…
Anna
  • 2,911
  • 6
  • 29
  • 42
10
votes
1 answer

Is it a good idea to use ESLint and stylelint together in the same project

Does ESLint and Stylelint do the same thing (linting) the project or is one used specifically for certain files? Can I use them both in the same project? Is it a good idea to use more than one linter in general in the same project?
Ahmed Ghonim
  • 4,455
  • 1
  • 17
  • 23
10
votes
2 answers

Not getting results or error from stylelint / stylelint-config-styled-components

I'm installing stylelint-config-styled-components on a react project. When I execute npm run lint:css (or use the stylelint command directly through the CLI) I don't get any results. I have intentionally put in extra spaces and duplicate style…
Bonnie
  • 611
  • 8
  • 25
9
votes
4 answers

stylelint giving error on iOs - Error: Could not find "stylelint-config-standard". Do you need a `configBasedir`?

It works ok on ubuntu I installed stylelint on iOS but when I run it I get Error: Could not find "stylelint-config-standard". Do you need a configBasedir? My config file is: $ cat .stylelintrc.json { "extends": "stylelint-config-standard", …
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
9
votes
3 answers

stylelint on create-react-app @import-normalize throw error

I followed this doc to add CSS reset to my app. https://create-react-app.dev/docs/adding-css-reset/#indexcss But it showed this message: "stylelint": { "extends": "stylelint-config-recommended", "rules": { "at-rule-no-unknown": null } How to fix…
codenoobforreal
  • 101
  • 1
  • 5
1
2 3
18 19