mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* [eslint] automatically determine dev packages (#127089)
* [eslint] automatically determine dev packages
* remove old eslint overrides that are not needed anymore
(cherry picked from commit 1f514d7c00
)
# Conflicts:
# .eslintrc.js
# packages/kbn-optimizer/package.json
# packages/kbn-plugin-generator/package.json
# packages/kbn-type-summarizer/package.json
* remove unnecessary eslint-override
This commit is contained in:
parent
1765d1dea3
commit
98a5154100
14 changed files with 25 additions and 27 deletions
29
.eslintrc.js
29
.eslintrc.js
|
@ -6,6 +6,11 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
const Path = require('path');
|
||||
const Fs = require('fs');
|
||||
|
||||
const globby = require('globby');
|
||||
|
||||
const APACHE_2_0_LICENSE_HEADER = `
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
|
@ -89,22 +94,16 @@ const SAFER_LODASH_SET_DEFINITELYTYPED_HEADER = `
|
|||
*/
|
||||
`;
|
||||
|
||||
const packagePkgJsons = globby.sync('*/package.json', {
|
||||
cwd: Path.resolve(__dirname, 'packages'),
|
||||
absolute: true,
|
||||
});
|
||||
|
||||
/** Packages which should not be included within production code. */
|
||||
const DEV_PACKAGES = [
|
||||
'kbn-babel-code-parser',
|
||||
'kbn-dev-utils',
|
||||
'kbn-cli-dev-mode',
|
||||
'kbn-docs-utils',
|
||||
'kbn-es*',
|
||||
'kbn-eslint*',
|
||||
'kbn-optimizer',
|
||||
'kbn-plugin-generator',
|
||||
'kbn-plugin-helpers',
|
||||
'kbn-pm',
|
||||
'kbn-storybook',
|
||||
'kbn-telemetry-tools',
|
||||
'kbn-test',
|
||||
];
|
||||
const DEV_PACKAGES = packagePkgJsons.flatMap((path) => {
|
||||
const pkg = JSON.parse(Fs.readFileSync(path, 'utf8'));
|
||||
return pkg.kibana && pkg.kibana.devOnly ? Path.dirname(Path.basename(path)) : [];
|
||||
});
|
||||
|
||||
/** Directories (at any depth) which include dev-only code. */
|
||||
const DEV_DIRECTORIES = [
|
||||
|
|
|
@ -8,5 +8,8 @@
|
|||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/elastic/kibana/tree/main/packages/kbn-babel-code-parser"
|
||||
},
|
||||
"kibana": {
|
||||
"devOnly": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,5 +4,8 @@
|
|||
"private": true,
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||
"main": "./target_node/index.js",
|
||||
"types": "./target_types/index.d.ts"
|
||||
"types": "./target_types/index.d.ts",
|
||||
"kibana": {
|
||||
"devOnly": true
|
||||
}
|
||||
}
|
|
@ -4,5 +4,8 @@
|
|||
"private": true,
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||
"main": "target_node/index.js",
|
||||
"types": "target_types/index.d.ts"
|
||||
"types": "target_types/index.d.ts",
|
||||
"kibana": {
|
||||
"devOnly": true
|
||||
}
|
||||
}
|
|
@ -6,7 +6,6 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { expectType } from 'tsd';
|
||||
import { MethodKeysOf } from '../..';
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { expectType } from 'tsd';
|
||||
import { PublicContract } from '../..';
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { expectType } from 'tsd';
|
||||
import { PublicKeys } from '../..';
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { expectAssignable, expectNotAssignable } from 'tsd';
|
||||
import { PublicMethodsOf } from '../..';
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { expectType } from 'tsd';
|
||||
import { ShallowPromise } from '../..';
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { expectAssignable } from 'tsd';
|
||||
import { UnionToIntersection } from '../..';
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { expectAssignable } from 'tsd';
|
||||
import { UnwrapObservable, ObservableLike } from '../..';
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { expectAssignable } from 'tsd';
|
||||
import { UnwrapPromise } from '../..';
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { expectAssignable } from 'tsd';
|
||||
import { Values } from '../..';
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { expectAssignable } from 'tsd';
|
||||
import { Writable } from '../..';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue