mirror of
https://github.com/bendtherules/react-fiber-traverse.git
synced 2026-08-18 13:52:36 +00:00
Modify lint-staged - Run prettier and eslint only on changed files
This commit is contained in:
+10
-1
@@ -1,3 +1,12 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
"*.{js,jsx,ts,tsx}": () => "run-s check:* lint"
|
"*.{js,jsx,ts,tsx}": filenames => {
|
||||||
|
// Escape filenames and join by space
|
||||||
|
const joinedFilenames = filenames.map(str => `"${str}"`).join(" ");
|
||||||
|
return [
|
||||||
|
"run-s check:!(format)",
|
||||||
|
`npm run check:format -- ${joinedFilenames}`,
|
||||||
|
`npm run _lint -- ${joinedFilenames}`
|
||||||
|
];
|
||||||
|
// `run-s check:!(format) "check:format -- ${joinedFilenames}" "_lint -- ${joinedFilenames}"`;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+2
-1
@@ -24,7 +24,8 @@
|
|||||||
"compile": "tsc -p tsconfig.base.json",
|
"compile": "tsc -p tsconfig.base.json",
|
||||||
"docs": "npx typedoc ./src/",
|
"docs": "npx typedoc ./src/",
|
||||||
"format": "prettier --write \"**/*.{js,ts,tsx}\"",
|
"format": "prettier --write \"**/*.{js,ts,tsx}\"",
|
||||||
"lint": "eslint . --ext .js,.ts,.jsx,.tsx",
|
"_lint": "eslint --ext .js,.ts,.jsx,.tsx",
|
||||||
|
"lint": "npm run _lint -- .",
|
||||||
"postbundle": "del compiled && cp-cli ./index.js ./dist/index.js",
|
"postbundle": "del compiled && cp-cli ./index.js ./dist/index.js",
|
||||||
"postversion": "git push && git push --tags && npm publish",
|
"postversion": "git push && git push --tags && npm publish",
|
||||||
"release": "npm version -m 'Release v%s'",
|
"release": "npm version -m 'Release v%s'",
|
||||||
|
|||||||
Reference in New Issue
Block a user