Skip to content

Commit

Permalink
add nps scripts to run custom lint rules on datapacks + scripts
Browse files Browse the repository at this point in the history
- `yarn start lint.custom.datapacks`
- `yarn start lint.custom.other`
- `yarn start lint.custom[.all]`
  • Loading branch information
TheAfroOfDoom committed Jan 14, 2024
1 parent 2684f97 commit da687ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/resourcepack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
node-version-file: package.json
- run: yarn
- name: Run lint scripts on resourcepack
run: yarn start lint.resourcepack
run: yarn start lint.custom.resourcepack
env:
FORCE_COLOR: 2
12 changes: 11 additions & 1 deletion package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
resourcepacks: `yarn rimraf --glob ${minecraftResourcePackPath}/**/*`,
},
lint: {
default: 'nps lint.resourcepack lint.scripts',
default: 'nps lint.custom.resourcepack lint.scripts',
fix: 'nps lint.scripts.fix',
scripts: {
default: 'nps lint.scripts.check',
Expand All @@ -69,7 +69,17 @@ module.exports = {
fix: 'prettier --write .',
},
},
custom: {
default: 'nps lint.custom.all',
all: series.nps(
'lint.custom.datapacks',
'lint.custom.resourcepack',
'lint.custom.other',
),
datapacks: `node ./package-scripts/run-linting-rules --include "${datapacksGlob}"`,
resourcepack: `node ./package-scripts/run-linting-rules --include "${resourcepackGlob}"`,
other: `node ./package-scripts/run-linting-rules --include "**/*" --exclude "${resourcepackGlob},${datapacksGlob}"`,
},
},
},
};

0 comments on commit da687ff

Please sign in to comment.