1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/packages/infrastructure/eslint-config/bin/lint
Janne Savolainen 699fc0309e
Introduce eslint and prettier for features and start using it (#7306)
* Introduce package for sharing eslint and prettier configurations

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Start using eslint and prettier in packages

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

---------

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2023-03-10 12:25:04 +02:00

21 lines
504 B
JavaScript
Executable File

#!/usr/bin/env node
const execSync = require("child_process").execSync;
const argv = process.argv
const shouldDoTheFix = argv.includes('--fix');
try {
execSync(`eslint ${shouldDoTheFix ? "--fix " : " "}--ext ts,tsx --max-warnings=0 .`);
} catch (error) {
console.log(error.stdout.toString());
}
try {
const result = execSync(`prettier ${shouldDoTheFix ? "--write" : "--check"} "**/*.{js,ts,tsx}"`);
console.log(result.toString());
} catch (error) {
console.log(error.stdout.toString());
}