mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
Merge branch 'esfix' into 'main'
ci: Add --fix flag to eslint See merge request GNOME/gnome-shell!3342
This commit is contained in:
commit
7488917f56
1 changed files with 4 additions and 1 deletions
|
|
@ -23,15 +23,18 @@ function getOption(...names) {
|
|||
|
||||
(async function main() {
|
||||
const outputOption = getOption('--output-file', '-o');
|
||||
const fixOption = hasOption('--fix');
|
||||
const outputPath = outputOption ? path.resolve(outputOption) : null;
|
||||
|
||||
const sourceDir = path.dirname(process.argv[1]);
|
||||
process.chdir(path.resolve(sourceDir, '..'));
|
||||
|
||||
const sources = ['js', 'subprojects/extensions-app/js', 'tests'];
|
||||
const eslint = new ESLint({cache: true});
|
||||
const eslint = new ESLint({cache: true, fix: fixOption});
|
||||
|
||||
const results = await eslint.lintFiles(sources);
|
||||
if (fixOption)
|
||||
await ESLint.outputFixes(results);
|
||||
const formatter = await eslint.loadFormatter(getOption('--format', '-f'));
|
||||
const resultText = formatter.format(results);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue