sasstools / grunt-sass-lint Goto Github PK
View Code? Open in Web Editor NEWGrunt plugin for Sass Lint
License: MIT License
Grunt plugin for Sass Lint
License: MIT License
Usually the "target" property is used when there are output files, and the "src" property for specifying input files. Admittedly it makes little practical difference, but it's definitely confusing and going against pretty much every other grunt plugin out there that you need to specify "target" to use this plugin and not "src".
I'm trying to make a sub task but I can not get it to run.
sasslint: {
search: {
target: ['src/search/**/**.scss']
}
}
grunt sasslint:search
:root {
box-sizing: border-box;
}
%boxsizing {
box-sizing: inherit;
}
* {
@extend %boxsizing;
&:before,
&:after {
@extend %boxsizing;
}
}
Returns:
Running "sasslint:main" (sasslint) task
build/sass/src/_default.scss
12:1 warning Space expected between blocks empty-line-between-blocks
✖ 1 problem (0 errors, 1 warning)
Hi all,
I'm having problems with the trailing semicolon rule, because it is just linting ok when it is the last line of a block. For example:
body {
display: block;
background: red
}
Would break.
But:
body {
display: block
background: red;
}
Would not.
Do you have any fixes on this?
I don't know if this should be here, or in sass-lint repo, so sorry if it is the wrong place.
Thanks in advance.
When formatter: 'table' is set:
Node: v0.12.15
npm: 2.15.1
node_modules/grunt-sass-lint/node_modules/sass-lint/node_modules/eslint/node_modules/table/dist/table.js:112
let userConfig = arguments.length > 1 && arguments[1] !== undefined ? argume
^^^
Unexpected strict mode reserved word Use --force to continue.
Aborted due to warnings.
Works with table "version": "3.7.8"
Error with table "version": "3.8.3"
I'm not sure if it's my setup but using using * selectors in the target results in the error:
Warning: Cannot read property 'start' of undefined Use --force to continue.
So this works:
options: {
configFile: '.sass-lint.yml'
},
target: ['scss/style.scss']
But this doesnt:
options: {
configFile: '.sass-lint.yml'
},
target: ['scss/*.scss']
Anyone else experience this problem? Using node 4.1.1 if that makes any difference.
Just noticed that when installing grunt-sass-lint from npm it brings down sass-lint 1.0.0
see here sasstools/sass-lint#295
Looks like even though package.json has been updated this package hasn't been pushed to NPM..
Should probably do that quite soon as this is seriously behind now!
When you use a config file that is in a different repo (for example, node_modules) then ignore path seems to be confused as to where it is. I have a project that gets it's front end from a private node_module and I set the config path in my gruntfile to configFile: 'node_modules/my-repo/.sass-lint.yml'
.
Inside that sass-lint.yml I have include and ignore rules:
files:
include: 'src/stylesheets/**/*.s+(a|c)ss'
ignore: 'src/stylesheets/common/generated/**/*.scss'
The include works as expected, but the ignore doesn't.
The ignore does work if I explicitly set the path to 'node_modules/my-repo/src/src/stylesheets/common/generated/*/.scss'. However, that's not a solution as I need to be able to run the linting from the repo itself, as well as from the project that consumes the node_module.
It would be useful if an option could be passed to sass-lint that would let you change the path to the config file if you'd prefer not have another file in the project root, or have a dedicated folder containing all of your config files.
Edit: I've posted this in the main sass-lint repo as it's more relevant there, but I thought I'd leave this issue open here for the ability to pass the option through.
is there a way to set the cli options from the grunt config? my attempts have fallen short so far.
my specific use case is that i would like to ensure that build fails on warnings (since there doesn't seem to be a way to make all of them error level by default). i see that there is a max-warnings option that i would like to set to 0
, but i can't figure out how to set it.
Running "sasslint:target" (sasslint) task
Warning: previous.is is not a function� Use --force to continue.
Aborted due to warnings.
Execution Time (2016-10-04 17:03:40 UTC+2)
loading tasks 1.3s ███████████████████████████████████████ 86%
sasslint:target 220ms ███████ 14%
Total 1.5s
Version 1.2.0 is available for Sass Lint. It has some bug fixes and improvements that would be nice to get in here.
Hi, I'm using v0.2.2. I'm trying to use the yml from Bootstrap but the yml file is not loading when I run grunt sasslint
command. I'm using the exact file that you can get in Bootstrap repo except different indentation settings (4 space)
Indentation:
enabled: true
allow_non_nested_indentation: false
character: space # or 'tab'
width: 4
My Gruntfile.js
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
sasslint: {
options: {
configFile: '.scss-lint.yml',
},
target: ['scss/style.scss']
}
});
grunt.loadNpmTasks('grunt-sass-lint');
};
My directory tree
.
├── .scss-lint.yml
├── Gruntfile.js
├── package.json
└── scss
└── style.scss
If you need to know anything else, please ask. Thank you.
If I run the linter with one file in my target
array, I get 11 warnings:
Great. Everything above looks like it's running correctly. Now I add an additional file to the target
array (as the first item in the array):
... and now I'm only getting linting errors for the first file (3 warnings only):
... so it appears that the second file is not being linted, even though it says it is.
I'm currently outputting all warnings/errors to file, but would like the build to continue regardless. I'd also like to output all warnings regardless of severity.
I see in the sass-lint options they have --verbose
and --no-exit
flags (alternatives being -v and -q) available: is there any way we can pass these through via grunt-sass-lint?
I'm getting this error when I try running sass lint on a newly created project.
/usr/local/bin/node /Users/adamyoungers/projects/pikadeck/node_modules/grunt-cli/bin/grunt --gruntfile /Users/adamyoungers/projects/pikadeck/Gruntfile.js sasslint
Running "sasslint:test" (sasslint) task
(node:21555) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
Done.
Process finished with exit code 0
Is there a way to enforce warning to fail the build? At present it returns:
91:5 warning Indentation of 4, expected 2 indentation
92:5 warning Indentation of 4, expected 2 indentation
93:5 warning Indentation of 4, expected 2 indentation
✖ 44 problems (0 errors, 44 warnings)
Done, without errors.
But it would be nice if warning could be set to fail either as a global or per-rule.
Could you add the possibility to use grunt-newer
in order to check the files on the flight?
I'd like to execute the task each time that the ¨watch¨
task is called (I can do it manually, but it is not the best solution).
Thanks!
running npm install grunt-sass-lint --save-dev
I get the following error:
npm ERR! notarget No compatible version found: grunt-sass-lint@'*'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["0.1.0-beta.1","0.1.0-beta.2","0.1.0-beta.3"]
npm ERR! notarget
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm install [email protected] --save-dev
works
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.