False positive errors when using sass:map and using module's namespace
sheldonmaschmeyer opened this issue · comments
Sheldon commented
Stylelint has good support for .SCSS but, it seems to struggle with .SASS.
For instance, below is my simplified config file for .sass
{
"customSyntax": "postcss-sass",
"extends": "stylelint-config-sass-guidelines"
}
This will work with simple .sass files such as
.container
background-color: #xxxxx
padding-top: xxx
padding-bottom: xxx
However, it will detect the following as an error:
@use 'sass:map'
@use '../../../myVariables.sass' as MyVariables
$hover: map.get(MyVariables.$custom-vars, 'hover')
It detects two errors. 1) MyVariables.$custom-vars and 2) with --fix it changes `map.get` to `mapget`
The .scss config will work perfectly (on scss version of the file)
{
"extends": [
"stylelint-config-recommended-scss"
]
}
@use 'sass:map';
@use '../../../myVariables.scss' as MyVariables;
$hover: map.get(MyVariables.$custom-vars, 'hover');
There are no errors.
Note: I am using Vite with React (no CRA Webpack)
Advice is appreciated.
Brett Jankord commented
This linter has been designed / tested with SCSS syntax based on the SCSS guidelines documented in https://sass-guidelin.es/. It is intended for use with SCSS syntax, not Sass (tab style) syntax.