Giter VIP home page Giter VIP logo

stylelint-config-xo-scss's People

Contributors

charlesbjohnson avatar richienb avatar sindresorhus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

richienb

stylelint-config-xo-scss's Issues

Inconsistent rule for 'scss/at-import-partial-extension'

Problem

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:

Minimal Reproducible Example

@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.

Possible Solution

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"] }]

Invalid option value "true" for rule "scss/at-import-partial-extension"

About

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"

Minimal Reproducible Example

$ 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.

Work Around

Add this line into your stylelint.config.js:

  rules: {'scss/at-import-partial-extension': 'always'}

Possible Solution

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 ๐Ÿ˜„

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.