Skip to content

Commit

Permalink
perf(linters): Greatly improve the npm run lint task speed
Browse files Browse the repository at this point in the history
The `npm run lint` task now takes about ~3s on my machine (was
taking XXX).

Previously:
```
$ time npm run lint
npm run lint  10,84s user 1,22s system 107% cpu 11,187 total
```
Now:
```
$ time npm run lint
npm run lint  3,73s user 0,28s system 116% cpu 3,445 total
```

Basically all I did was specify the `./**/*.js` or `./**/*.scss`
pattern on both linters and that makes it much faster.

For scss, I also cleaned up a bit the list of ignore patterns (as we
now use Jekyll 3, some files do not have the front-matter anymore and
so we do not need to exclude them).
  • Loading branch information
pixelastic committed Mar 7, 2016
1 parent 438d43d commit 1ba53b0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
10 changes: 4 additions & 6 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
options:
formatter: stylish
files:
include: '**/*.scss'
include:
'+(docs|src)/**/*.scss'
ignore:
- 'node_modules/**/*'
- 'docs/examples/*/main.scss' # Jekyll files requiring front-matter
- 'docs/css/main.scss' # Jekyll files requiring front-matter
- 'docs/css/examples/*/main.scss' # Jekyll files requiring front-matter
- 'docs/css/bootstrap/**/*' # Vendor
- 'docs/css/bootstrap/**/*.scss' # Vendor
- 'docs/css/_syntax-highlighting.scss' # Vendor
- 'docs/examples/**/main.scss' # Files with front-matter
# Contains asset_path() call to jekyll-assets. sass-lint cannot disable rules inline
# https://github.com/sasstools/sass-lint/issues/544
- 'docs/css/_home.scss'
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"dev:docs": "./scripts/dev-docs.sh",
"doctoc": "doctoc --maxlevel 3 README.md CONTRIBUTING.md",
"lint": "npm run lint:js && npm run lint:css",
"lint:js": "eslint . --quiet --no-color",
"lint:css": "sass-lint --verbose",
"lint:js": "./scripts/lint-js",
"lint:css": "./scripts/lint-css",
"docs:jsdoc": "babel-node ./scripts/docs/gen-widget-doc.js",
"docs:update-website": "./scripts/docs/update-website.sh",
"docs:update-website-search-index": "./scripts/docs/update-website-search-index.sh",
Expand Down
2 changes: 2 additions & 0 deletions scripts/lint-css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
sass-lint --verbose
2 changes: 2 additions & 0 deletions scripts/lint-js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
eslint ./*.js ./**/*.js --quiet

0 comments on commit 1ba53b0

Please sign in to comment.