1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00

Tools: Change order of pre-commit hooks

This commit is contained in:
Laurent Cozic 2023-08-22 11:46:35 +01:00
parent 2fda252a5e
commit 26a967e53c
5 changed files with 21 additions and 4 deletions

View File

@ -923,6 +923,7 @@ packages/tools/generate-images.js
packages/tools/git-changelog.test.js
packages/tools/git-changelog.js
packages/tools/licenseChecker.js
packages/tools/packageJsonLint.js
packages/tools/release-android.js
packages/tools/release-cli.js
packages/tools/release-electron.js

1
.gitignore vendored
View File

@ -909,6 +909,7 @@ packages/tools/generate-images.js
packages/tools/git-changelog.test.js
packages/tools/git-changelog.js
packages/tools/licenseChecker.js
packages/tools/packageJsonLint.js
packages/tools/release-android.js
packages/tools/release-cli.js
packages/tools/release-electron.js

View File

@ -11,8 +11,9 @@ module.exports = {
//
// '**/*.ts?(x)': () => 'npm run tsc',
'*.{js,jsx,ts,tsx}': [
'yarn run linter-precommit',
'yarn run checkIgnoredFiles',
'yarn run checkLibPaths',
'node packages/tools/checkIgnoredFiles.js',
'yarn run packageJsonLint',
'yarn run linter-precommit',
],
};

View File

@ -24,6 +24,7 @@
"buildWebsiteTranslations": "node packages/tools/website/buildTranslations.js",
"buildWebsite": "node ./packages/tools/website/build.js && yarn run buildPluginDoc && yarn run buildSettingJsonSchema",
"checkLibPaths": "node ./packages/tools/checkLibPaths.js",
"checkIgnoredFiles": "node ./packages/tools/checkIgnoredFiles.js",
"circularDependencyCheck": "madge --warning --circular --extensions js ./",
"clean": "npm run clean --workspaces --if-present && node packages/tools/clean && yarn cache clean",
"dependencyTree": "madge",
@ -33,7 +34,7 @@
"linter-precommit": "eslint --resolve-plugins-relative-to . --fix --ext .js --ext .jsx --ext .ts --ext .tsx",
"linter": "eslint --resolve-plugins-relative-to . --fix --quiet --ext .js --ext .jsx --ext .ts --ext .tsx",
"linter-interactive": "eslint-interactive --resolve-plugins-relative-to . --fix --quiet --ext .js --ext .jsx --ext .ts --ext .tsx",
"packageJsonLint": "npmPkgJsonLint --configFile .npmpackagejsonlintrc.json --quiet .",
"packageJsonLint": "node ./packages/tools/packageJsonLint.js",
"postinstall": "gulp build",
"publishAll": "git pull && yarn run buildParallel && lerna version --yes --no-private --no-git-tag-version && gulp completePublishAll",
"releaseAndroid": "PATH=\"/usr/local/opt/openjdk@11/bin:$PATH\" node packages/tools/release-android.js",
@ -60,7 +61,7 @@
},
"husky": {
"hooks": {
"pre-commit": "lint-staged && yarn run packageJsonLint"
"pre-commit": "lint-staged"
}
},
"devDependencies": {

View File

@ -0,0 +1,13 @@
import { execCommand, getRootDir } from '@joplin/utils';
import { chdir } from 'process';
const main = async () => {
const rootDir = await getRootDir();
chdir(rootDir);
await execCommand('yarn run npmPkgJsonLint --configFile .npmpackagejsonlintrc.json --quiet .');
};
main().catch((error) => {
console.error(error);
process.exit(1);
});