Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process never finishes #65

Open
TheJaredWilcurt opened this issue Nov 17, 2016 · 5 comments
Open

Process never finishes #65

TheJaredWilcurt opened this issue Nov 17, 2016 · 5 comments

Comments

@TheJaredWilcurt
Copy link

I've tried the sample code from the README, and I've tried stealing someone else code from a random project.

In both cases Gulp-Sass-Lint will run, scan all the Sass files I told it to, then either do nothing, or display errors it found in the file. But it never actually stops running. I have to manually stop it.

This means, that if I have a serve task to run a local express server, I can't actually go to the localhost:8000 in the browser, nothing will load because the Gulp-Sass-Lint never stopped running. If I remove it from my list of default tasks, then the server runs fine:

gulp.task('default', ['sass', 'sasslint', 'lint', 'uglify', 'watch', 'serve', 'open']);

If I just run gulp sasslint, again, it works like normal, but it never finishes. Opening up task manager shows I have a node process maxing out one of my CPU's.

Software Version
Node 5.5.0
NPM 3.3.12
Gulp-Sass-Lint 1.3.2

Windows 7 Professional 64-bit

@simeydotme
Copy link

Yeh, I've had this problem for like 11 months, so much unlinted code has accumulated in my repository because I can't get this running during deployment :(

@TheJaredWilcurt
Copy link
Author

@simeydotme
I've created my own script to allow me to run Sass-Lint without Gulp.

  1. Copy this sasslinter.js to the root of your project:
  2. In the root of your project, create a .sass-lint.yml file that contains all your rules. Here is mine:
  3. In your package.json add this:
    "devDependencies": {
        "node-sass": "^3.x.x",
        "sass-lint": "^1.10.2",
        "pre-commit": "^1.1.3"
    },
    "scripts": {
        "sasslint": "node sasslinter.js"
    },
    "pre-commit": [ "sasslint" ]
  4. Run npm install from your project root.
  5. Run npm run sasslint to manually run the linter

You'll also notice that anytime you go to do a commit it will run the Sass linter script before hand. Currently it doesn't stop the commit if it finds anything. But it will print out anything it finds and then perform the commit. So it at least forces you to acknowledge that there is a problem anytime you do a commit.

If you make any improvements to this script, let me know so I can update mine.

@simeydotme
Copy link

thanks @TheJaredWilcurt , I'll give it a shot :)

I'm thinking that the sasslint script could be put in a test script, and the pre-commit could run test instead? 🤔 ... I'll try that, as well, and report back! :)

@simeydotme
Copy link

I switched to stylelint :)

@TheJaredWilcurt
Copy link
Author

That doesn't support .sass files. My method does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants