Skip to content

Commit

Permalink
Add JavaScript linting using ESLint and WordPress standards
Browse files Browse the repository at this point in the history
Commands:

- `npm run lint:js` to display JS coding violations
- `npm run fix:js` to fix JS violations that can be auto-corrected.
  • Loading branch information
nickcernis authored and dreamwhisper committed Mar 18, 2019
1 parent 0cd81ba commit 118002e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
vendor
*.min.js
js/responsive-menus.js
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
"extends": "wordpress",
};
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"adm-zip": "^0.4.13",
"autoprefixer": "^9.4.2",
"chalk": "^2.4.1",
"eslint": "^5.15.2",
"eslint-config-wordpress": "^2.0.0",
"node-wp-i18n": "^1.2.1",
"npm-run-all": "^4.1.5",
"postcss-cli": "^6.0.1",
Expand All @@ -20,6 +22,8 @@
"autoprefixer": "postcss style.css lib/**/*.css --use autoprefixer --replace --no-map --verbose",
"makepot": "node .scripts/makepot.js",
"lint:css": "stylelint \"style.css\" \"lib/gutenberg/*.css\" \"lib/woocommerce/*.css\"",
"lint:js": "eslint .",
"fix:js": "eslint . --fix",
"build:export-zip": "git archive -o genesis-sample.zip --prefix=genesis-sample/ HEAD",
"build:md-to-txt": "node .scripts/md-to-txt.js",
"zip": "run-s build:export-zip build:md-to-txt"
Expand Down

0 comments on commit 118002e

Please sign in to comment.