mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[generate/package] run ESLint and auto-fix generated files (#130676)
This commit is contained in:
parent
7df6a0dad5
commit
37bfb50663
1 changed files with 10 additions and 0 deletions
|
@ -11,6 +11,7 @@ import Path from 'path';
|
|||
|
||||
import normalizePath from 'normalize-path';
|
||||
import globby from 'globby';
|
||||
import { ESLint } from 'eslint';
|
||||
|
||||
import micromatch from 'micromatch';
|
||||
import { REPO_ROOT } from '@kbn/utils';
|
||||
|
@ -129,6 +130,15 @@ ${BAZEL_PACKAGE_DIRS.map((dir) => ` ./${dir}/*\n`).join
|
|||
|
||||
log.info('Wrote plugin files to', packageDir);
|
||||
|
||||
log.info('Linting files');
|
||||
const eslint = new ESLint({
|
||||
cache: false,
|
||||
cwd: REPO_ROOT,
|
||||
fix: true,
|
||||
extensions: ['.js', '.mjs', '.ts', '.tsx'],
|
||||
});
|
||||
await ESLint.outputFixes(await eslint.lintFiles([packageDir]));
|
||||
|
||||
const packageJsonPath = Path.resolve(REPO_ROOT, 'package.json');
|
||||
const packageJson = JSON.parse(await Fsp.readFile(packageJsonPath, 'utf8'));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue