Skip to content

Commit

Permalink
Add stylelinting to ensure mapboxgl- prefix on all classes (#4584)
Browse files Browse the repository at this point in the history
* Add stylelint CLI and Add mapbox class name rule in stylelintrc

* # This is a combination of 3 commits.
# This is the 1st commit message:
Stylelint works for application

# This is the commit message #2:

WIP modify lint-css script in package.json

# This is the commit message #3:

Ammend warning for lint-css npm script

* Stylelint implemented for application

WIP modify lint-css script in package.json

Ammend warning for lint-css npm script

Add csscolorparser

* Add lintx to script file

* Took out lintx

* Took out lintx

* Resolve comments to 4584 PR

* Resolve PR comments

* Ignore stylelint in .flowconfig and remove true from scripts
  • Loading branch information
ai-santos authored and mollymerp committed Apr 25, 2017
1 parent 5653c78 commit 5ceec40
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

.*/node_modules/jsonlint/.*
.*/node_modules/jsonlint-lines-primitives/.*
.*node_modules.*/stylelint.*
.*/node_modules/unflowify/.*
.*/test/unit/style-spec/fixture/invalidjson.input.json

Expand Down
5 changes: 5 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"selector-class-pattern": "mapboxgl-[a-z-]+"
}
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"request": "^2.79.0",
"sinon": "^2.1.0",
"st": "^1.2.0",
"stylelint": "^7.10.1",
"tap": "^10.3.0",
"vinyl": "^2.0.1",
"vinyl-fs": "^2.4.4",
Expand Down Expand Up @@ -115,8 +116,9 @@
"start-docs": "npm run build-min && npm run build-docs && jekyll serve --watch",
"lint": "eslint --cache --ignore-path .gitignore src test bench docs/_posts/examples/*.html debug/*.html",
"lint-docs": "documentation lint src/index.js",
"lint-css": "stylelint 'dist/mapbox-gl.css'",
"open-changed-examples": "git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",
"test": "run-s lint test-unit test-flow",
"test": "run-s lint lint-css test-unit test-flow",
"test-suite": "run-s test-render test-query",
"test-suite-clean": "find test/integration/*-tests -mindepth 2 -type d -not \\( -exec test -e \"{}/style.json\" \\; \\) -print | xargs -t rm -r",
"test-unit": "tap --reporter dot --no-coverage test/unit",
Expand Down

0 comments on commit 5ceec40

Please sign in to comment.