Skip to content

Commit

Permalink
fix: generated scripts section
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Schleemann committed Dec 9, 2024
1 parent f3996be commit 3a142fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions packages/linting/bin/linting.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,13 @@ const main = async () => {

if (await confirm('Add commands to package.json scripts?')) {
const scripts = (pkg.scripts ??= {});
const run = getCommand.bind(null, packageManager, 'run');
const run = (...params) => {
const {command, args} = getCommand(packageManager, 'run', params);
return `${command} ${args.join(' ')}`;
};
const additionalEslintArgs =
'--report-unused-disable-directives --max-warnings 0';
scripts['lint'] = `${run(['lint:fix'])} && ${run(['prettier:fix'])}`;
scripts['lint'] = `${run('lint:fix')} && ${run('prettier:fix')}`;
scripts['lint:check'] = `eslint . ${additionalEslintArgs}`;
scripts['lint:fix'] = `eslint . --fix ${additionalEslintArgs}`;
scripts['prettier:check'] = 'prettier . --check';
Expand Down
2 changes: 1 addition & 1 deletion packages/linting/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@atmina/linting",
"version": "3.0.1",
"version": "3.0.2",
"description": "A collection of opinionated in-house linting rules.",
"main": "index.js",
"scripts": {},
Expand Down

0 comments on commit 3a142fc

Please sign in to comment.