-
Notifications
You must be signed in to change notification settings - Fork 3.1k
CSS: Add package.json for linting and compiling #1159
Changes from all commits
3b576e6
9d783c0
aaf2c8b
561302f
fd9efee
275dcbb
baf9ec0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Dependency directories | ||
| node_modules/ | ||
| yarn.lock | ||
| package-lock.json | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "name": "_s", | ||
| "version": "1.0.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add a licence and repository field too. |
||
| "license": "GPL-2.0+", | ||
| "scripts": { | ||
| "build:css": "npm run compile:css && npm run prefix:css && npm run format:css && npm run fix:css", | ||
| "compile:css": "node-sass sass/style.scss style.css --output-style expanded --indent-type tab --indent-width 1", | ||
| "prefix:css": "postcss style.css -u autoprefixer -o style.css --no-map", | ||
| "lint:scss": "stylelint 'sass/**/*.scss' --syntax scss --config node_modules/stylelint-config-wordpress/scss.js", | ||
| "lint:css": "stylelint style.css", | ||
| "fix:scss": "stylelint 'sass/**/*.scss' --syntax scss --fix --config node_modules/stylelint-config-wordpress/scss.js", | ||
| "fix:css": "stylelint style.css --fix", | ||
| "format:css": "stylefmt style.css" | ||
| }, | ||
| "devDependencies": { | ||
| "autoprefixer": "^7.1.6", | ||
| "browserslist": "^2.9.0", | ||
| "node-sass": "^4.6.1", | ||
| "postcss-cli": "^4.1.1", | ||
| "stylefmt": "^6.0.0", | ||
| "stylelint": "^8.2.0", | ||
| "stylelint-config-wordpress": "^12.0.0" | ||
| }, | ||
| "stylelint": { | ||
| "defaultSeverity": "warning", | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @grappler Not sure if this is wanted here?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am fine with leaving like this. We can look in the future to change the command to something like https://medium.com/@bjankord/how-to-lint-scss-with-stylelint-dc87809a9878 |
||
| "extends": "stylelint-config-wordpress" | ||
| }, | ||
| "browserslist": [ | ||
| "> 1%", | ||
| "ie >= 11", | ||
| "last 1 Android versions", | ||
| "last 1 ChromeAndroid versions", | ||
| "last 2 Chrome versions", | ||
| "last 2 Firefox versions", | ||
| "last 2 Safari versions", | ||
| "last 2 iOS versions", | ||
| "last 2 Edge versions", | ||
| "last 2 Opera versions" | ||
| ] | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When does
yarn.lockget created? On my system I am only gettingpackage-lock.jsongenerate which we should ignore too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ayarn.lockfile is only generated if someone runsyarn install`Likewise, a
package-lock.jsonis only generated if you runnpm installThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stumbled upon this while having my first contact with wordpress after long not touching it. Generally, the lock files are meant to be comitted. Is there any special reason you want to exclude them?
https://stackoverflow.com/questions/44206782/do-i-commit-the-package-lock-json-file-created-by-npm-5