Skip to content

Commit

Permalink
style(cli-style): update style for cli-style 8.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed May 20, 2021
1 parent 10967ba commit ef03817
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable import/no-unused-modules */

module.exports = {
extends: ['@commitlint/config-conventional'],
}
1 change: 1 addition & 0 deletions .hooks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn d2-style check commit "$1"
4 changes: 4 additions & 0 deletions .hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn d2-style check --staged
15 changes: 0 additions & 15 deletions .huskyrc.js

This file was deleted.

2 changes: 2 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable import/no-unused-modules */

const { config } = require('@dhis2/cli-style')

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable import/no-unused-modules */

module.exports = {
extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
plugins: ['stylelint-no-unsupported-browser-features'],
Expand Down
13 changes: 13 additions & 0 deletions d2-style.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* eslint-disable import/no-unused-modules */

module.exports = {
patterns: {
js: [
'*.{js,jsx,ts,tsx}',
'!coverage/**/*.js',
'!src/locales/**/*.js',
'!d2.config.js',
],
text: '*.{md,json,yml,html}',
},
}
14 changes: 2 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
"start": "d2-app-scripts start",
"test": "d2-app-scripts test --coverage",
"test:watch": "d2-app-scripts test --watch",
"lint": "yarn lint:js && yarn lint:text && yarn lint:css",
"lint:js": "d2-style js check",
"lint:text": "d2-style text check",
"lint": "d2-style check && yarn lint:css",
"lint:css": "stylelint './src/**/*.css' && prettier './src/**/*.css' --check",
"format": "yarn format:js && yarn format:text && yarn format:css",
"format:js": "d2-style js apply",
"format:text": "d2-style text apply",
"format": "d2-style apply && yarn format:css",
"format:css": "prettier './src/**/*.css' --write",
"cypress:open": "d2-utils-cypress open --appStart 'yarn start'",
"cypress:run": "d2-utils-cypress run --appStart 'yarn start'",
Expand Down Expand Up @@ -50,12 +46,6 @@
"stylelint-config-standard": "^22.0.0",
"stylelint-no-unsupported-browser-features": "^4.1.4"
},
"husky": {
"hooks": {
"commit-msg": "d2-style commit check",
"pre-commit": "d2-style js apply && npm run lint:css && npm run lint:js"
}
},
"jest": {
"setupFilesAfterEnv": [
"<rootDir>/src/setupTests.js"
Expand Down

0 comments on commit ef03817

Please sign in to comment.