mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
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>
This commit is contained in:
1 parent
2789bcebcb
commit
4b78f62be8
6 files changed
+2806
-419
No files matched your search
+20
@@ -0,0 +1,20 @@
|
||||
#!/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());
|
||||
}
|
||||
Reference in new issue
Block a user