Skip to content

Commit

Permalink
refactor lint package-script
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAfroOfDoom committed Jan 8, 2024
1 parent 5c129ac commit 4585223
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
node-version-file: package.json
- run: yarn
- name: Run Prettier
run: yarn start lint.prettier.check
run: yarn start lint.scripts.prettier.check

lint:
runs-on: ubuntu-latest
Expand All @@ -34,4 +34,4 @@ jobs:
node-version-file: package.json
- run: yarn
- name: Run ESLint
run: yarn start lint.eslint.check
run: yarn start lint.scripts.eslint.check
34 changes: 22 additions & 12 deletions package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,28 @@ module.exports = {
resourcepacks: `yarn rimraf --glob ${minecraftResourcePackPath}/**/*`,
},
lint: {
default: 'nps lint.check',
check: series('nps lint.prettier.check', 'nps lint.eslint.check'),
fix: series('nps lint.prettier.fix', 'nps lint.eslint.fix'),
eslint: {
default: 'nps lint.eslint.check',
check: 'eslint .',
fix: 'eslint --fix .',
},
prettier: {
default: 'nps lint.prettier.check',
check: 'prettier --check .',
fix: 'prettier --write .',
default: 'nps lint.resourcepack lint.scripts',
fix: 'nps lint.scripts.fix',
scripts: {
default: 'nps lint.scripts.check',
check: series(
'nps lint.scripts.prettier.check',
'nps lint.scripts.eslint.check',
),
fix: series(
'nps lint.scripts.prettier.fix',
'nps lint.scripts.eslint.fix',
),
eslint: {
default: 'nps lint.scripts.eslint.check',
check: 'eslint .',
fix: 'eslint --fix .',
},
prettier: {
default: 'nps lint.scripts.prettier.check',
check: 'prettier --check .',
fix: 'prettier --write .',
},
},
resourcepack: `node ./package-scripts/run-linting-rules --glob "${resourcepackGlob}"`,
},
Expand Down

0 comments on commit 4585223

Please sign in to comment.