Skip to content

Commit

Permalink
feat(lint-staged): make settings more simple (#440)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the `lint-staged` field structure in `package.json` is changed
  • Loading branch information
ybiquitous committed Jul 2, 2019
1 parent ff6c8bb commit 9660b11
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,16 @@
}
},
"lint-staged": {
"linters": {
"*.{js,jsx,mjs,ts,tsx}": [
"eslint --fix --no-ignore",
"git add"
],
"*.md": [
"remark --frail"
],
"*.{css,html,js,json,jsx,md,mdx,mjs,scss,ts,tsx,yaml,yml}": [
"prettier --write",
"git add"
]
},
"ignore": [
"CHANGELOG.md"
"*.{js,jsx,mjs,ts,tsx}": [
"eslint --fix --no-ignore",
"git add"
],
"!(CHANGELOG).md": [
"remark --frail"
],
"*.{css,html,js,json,jsx,md,mdx,mjs,scss,ts,tsx,yaml,yml}": [
"prettier --write",
"git add"
]
},
"prettier": {
Expand Down Expand Up @@ -126,6 +121,7 @@
"editorconfig",
"eslint",
"init",
"lint-staged",
"package",
"prettier",
"readme",
Expand Down
9 changes: 3 additions & 6 deletions test/fixtures/package-empty_expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@
}
},
"lint-staged": {
"linters": {
"*.{js,jsx,mjs,ts,tsx}": ["eslint --fix --no-ignore", "git add"],
"*.md": ["remark --frail"],
"*.{css,html,js,json,jsx,md,mdx,mjs,scss,ts,tsx,yaml,yml}": ["prettier --write", "git add"]
},
"ignore": ["CHANGELOG.md"]
"*.{js,jsx,mjs,ts,tsx}": ["eslint --fix --no-ignore", "git add"],
"!(CHANGELOG).md": ["remark --frail"],
"*.{css,html,js,json,jsx,md,mdx,mjs,scss,ts,tsx,yaml,yml}": ["prettier --write", "git add"]
},
"standard-version": {
"scripts": {
Expand Down
9 changes: 3 additions & 6 deletions test/fixtures/package-normal_expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@
},
"lint-staged": {
"*.css": "xyz",
"linters": {
"*.{js,jsx,mjs,ts,tsx}": ["eslint --fix --no-ignore", "git add"],
"*.md": ["remark --frail"],
"*.{css,html,js,json,jsx,md,mdx,mjs,scss,ts,tsx,yaml,yml}": ["prettier --write", "git add"]
},
"ignore": ["CHANGELOG.md"]
"*.{js,jsx,mjs,ts,tsx}": ["eslint --fix --no-ignore", "git add"],
"!(CHANGELOG).md": ["remark --frail"],
"*.{css,html,js,json,jsx,md,mdx,mjs,scss,ts,tsx,yaml,yml}": ["prettier --write", "git add"]
},
"standard-version": {
"scripts": {
Expand Down

0 comments on commit 9660b11

Please sign in to comment.