Skip to content

Commit

Permalink
Add linting commands for JS, CSS, and PHP (#175)
Browse files Browse the repository at this point in the history
* Add linting commands for JS, CSS, and PHP

Setup is copied from wc-admin, except for `install-if-deps-outdated`.

Commands added:
- npm run lint # for both JS and CSS
- npm run lint:css
- npm run lint:css-fix # lint and fix CSS
- npm run lint:js
- npm run lint:php
- npm run lint:php-fix # lint and fix PHP
  • Loading branch information
reykjalin committed Aug 8, 2019
1 parent ea26fd1 commit 4029776
Show file tree
Hide file tree
Showing 5 changed files with 1,018 additions and 229 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
@@ -0,0 +1,2 @@
bin/*
!bin/generate-docs
37 changes: 37 additions & 0 deletions .eslintrc
@@ -0,0 +1,37 @@
/** @format */

{
"root": true,
"parser": "babel-eslint",
"extends": [ "wpcalypso/react", "plugin:jsx-a11y/recommended" ],
"plugins": [ "jsx-a11y", "jest" ],
"env": {
"browser": true,
"jest/globals": true,
"node": true,
},
"globals": {
"wp": true,
"wpApiSettings": true,
"wcSettings": true,
},
"settings": {
"react": {
"version": "detect",
},
},
"rules": {
"camelcase": 0,
"indent": 0,
"max-len": [ 2, { "code": 140 } ],
"no-console": 1,
"react/no-danger": 0,
"react/react-in-jsx-scope": 0,
"wpcalypso/import-no-redux-combine-reducers": 0,
"wpcalypso/jsx-classname-namespace": 0,
"wpcalypso/redux-no-bound-selectors": 1,
"jsx-a11y/label-has-for": [ "error", {
"required": "id"
} ]
},
}
20 changes: 20 additions & 0 deletions .stylelintrc.json
@@ -0,0 +1,20 @@
{
"extends": "stylelint-config-wordpress",
"rules": {
"at-rule-empty-line-before": null,
"at-rule-no-unknown": null,
"comment-empty-line-before": null,
"declaration-block-no-duplicate-properties": null,
"declaration-colon-newline-after": null,
"declaration-property-unit-whitelist": null,
"font-weight-notation": null,
"max-line-length": null,
"no-descending-specificity": null,
"no-duplicate-selectors": null,
"rule-empty-line-before": null,
"selector-class-pattern": null,
"string-quotes": "single",
"value-keyword-case": null,
"value-list-comma-newline-after": null
}
}

0 comments on commit 4029776

Please sign in to comment.