npm install --save-dev stylelint-config-xo-scss
Add this to your Stylelint config:
{
"extends": "stylelint-config-xo-scss"
}
- stylelint-config-xo - Stylelint shareable config for XO with tab indent
- xo - JavaScript linter
Stylelint shareable config for XO with Sass support
License: MIT License
npm install --save-dev stylelint-config-xo-scss
Add this to your Stylelint config:
{
"extends": "stylelint-config-xo-scss"
}
The rule in https://github.com/xojs/stylelint-config-xo-scss/blob/master/index.js#L21 requires an extension for all imports. But the next line prohibites to use the .scss
extension.
If I want to import e.g some color values from an seperated color.scss
to an other scss file, then I want to use it like that:
@import './color.scss'
body {
background: $color-silver;
}
But the config does not allow this.
If I remove the scss
extension at the end, the rule scss/at-import-partial-extension
throws an eror.
If I add the scss
extension the scss/at-import-partial-extension-blacklist
rule throws an error.
So it's not possible to solve the errors at this point.
IMO it would be more consistent if we delete the scss/at-import-partial-extension-blacklist
. Then just every import needs the extension.
OR
We modify the scss/at-import-partial-extension
to something like that (needs extra PR in stylelint-scss
):
'scss/at-import-partial-extension': ['always', , { "except": ["scss"] }]
Since version 0.10.0
, the following error causes when extending this config:
Invalid Option: Invalid option value "true" for rule "scss/at-import-partial-extension"
$ mkdir stylelint-config-xo-scss-bug && cd $_
$ yarn add stylelint [email protected]
$ echo 'module.exports = {extends: "stylelint-config-xo-scss"}' > stylelint.config.js
$ echo '/* for testing */' > test.scss
$ yarn stylelint test.scss
yarn run v1.19.2
warning package.json: No license field
/.../stylelint-config-xo-scss-bug/node_modules/.bin/stylelint test.scss
Invalid Option: Invalid option value "true" for rule "scss/at-import-partial-extension"
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Add this line into your stylelint.config.js
:
rules: {'scss/at-import-partial-extension': 'always'}
This bug is introduced into 86e7d26.
We can easily fix this by modifying option value into "always"
.
However I wonder why the test miss this bug, and I guess the test is broken. It should be fixed.
Thank you ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.