Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump eslint@7 #94347

Merged
merged 71 commits into from
Oct 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
52b536f
Bump eslint
patrykkopycinski Mar 10, 2021
ec2b379
downgrade prettier
patrykkopycinski Mar 10, 2021
e0dcc5e
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Mar 10, 2021
2d4c0da
Fix lint and license
patrykkopycinski Mar 10, 2021
d6a84d8
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Mar 16, 2021
1f2adf6
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Mar 16, 2021
1932d6f
fix
patrykkopycinski Mar 16, 2021
cf86d85
update deps
patrykkopycinski Mar 16, 2021
52de147
cleanup yarn.lock
patrykkopycinski Mar 16, 2021
bee5789
fix
patrykkopycinski Mar 16, 2021
a033bdf
align types
patrykkopycinski Mar 16, 2021
c743304
fix redux
patrykkopycinski Mar 16, 2021
afa98c8
update type
patrykkopycinski Mar 16, 2021
9eb2bab
Merge branch 'master' into chore/eslint-7
kibanamachine Mar 16, 2021
2f33e84
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Mar 17, 2021
876951d
Merge branch 'chore/eslint-7' of github.com:patrykkopycinski/kibana i…
patrykkopycinski Mar 17, 2021
644df0c
update dist
patrykkopycinski Mar 17, 2021
9d53250
Merge branch 'master' into chore/eslint-7
kibanamachine Mar 17, 2021
d309e0e
Merge branch 'master' into chore/eslint-7
kibanamachine Mar 17, 2021
e5bc5ba
Merge branch 'master' into chore/eslint-7
kibanamachine Mar 17, 2021
f640ee2
Merge branch 'master' into chore/eslint-7
kibanamachine Mar 18, 2021
6481d0c
Merge branch 'master' into chore/eslint-7
kibanamachine Mar 21, 2021
ee1b405
Merge branch 'master' into chore/eslint-7
kibanamachine Mar 23, 2021
3f875eb
Merge branch 'master' into chore/eslint-7
kibanamachine Mar 24, 2021
2d3cba3
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Apr 1, 2021
f08c30d
fix imports
patrykkopycinski Apr 1, 2021
43a13a8
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Apr 6, 2021
898f2b3
update dist
patrykkopycinski Apr 6, 2021
9757d6d
config
patrykkopycinski Apr 6, 2021
df666f5
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Apr 8, 2021
c03e4d1
update .eslintrc.js
patrykkopycinski Apr 8, 2021
d0182d8
update config
patrykkopycinski Apr 9, 2021
ec83d0d
bump
patrykkopycinski Apr 9, 2021
9330682
Merge branch 'master' into chore/eslint-7
kibanamachine Apr 9, 2021
1f9712c
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Apr 26, 2021
1f2aecf
cleanup
patrykkopycinski Apr 26, 2021
2826422
update dist
patrykkopycinski Apr 26, 2021
fce22fd
update config
patrykkopycinski Apr 26, 2021
8a5a7f5
cleanup
patrykkopycinski Apr 26, 2021
8e2310c
lock
patrykkopycinski Apr 26, 2021
0c0f00d
test
patrykkopycinski Apr 27, 2021
19d7686
fix test name
patrykkopycinski Apr 27, 2021
d8b33f2
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski May 10, 2021
463d348
fix types
patrykkopycinski May 10, 2021
6b61d53
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Jul 5, 2021
553dc62
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Jul 6, 2021
d6a5c22
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Jul 6, 2021
435860e
fix
patrykkopycinski Jul 6, 2021
7daa14b
fix lint
patrykkopycinski Jul 6, 2021
c25daa3
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Jul 7, 2021
5fb5f52
estree
patrykkopycinski Jul 7, 2021
d4f5377
lock
patrykkopycinski Jul 7, 2021
917a9f5
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Sep 22, 2021
f4206bd
lock
patrykkopycinski Sep 22, 2021
71c676e
fix eslint
patrykkopycinski Sep 22, 2021
b11ee73
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Sep 22, 2021
d8a93a9
Merge branch 'master' into chore/eslint-7
kibanamachine Sep 22, 2021
e9dc116
Update alert_status_bulk_actions.tsx
patrykkopycinski Sep 22, 2021
3a0db23
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Sep 23, 2021
f2bcfb2
update config
patrykkopycinski Sep 23, 2021
04a32d5
fix lint
patrykkopycinski Sep 23, 2021
03759ce
lint
patrykkopycinski Sep 23, 2021
a850733
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Oct 1, 2021
170891d
fix types
patrykkopycinski Oct 1, 2021
8c589c0
lint
patrykkopycinski Oct 1, 2021
55dd104
Merge branch 'master' into chore/eslint-7
kibanamachine Oct 1, 2021
29c5f6d
Merge branch 'master' into chore/eslint-7
kibanamachine Oct 1, 2021
981740d
Merge branch 'master' of github.com:elastic/kibana into chore/eslint-7
patrykkopycinski Oct 2, 2021
a6b0560
bump
patrykkopycinski Oct 2, 2021
35a7e14
bump
patrykkopycinski Oct 2, 2021
52de2b1
bump
patrykkopycinski Oct 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ module.exports = {
{
files: [
'**/*.stories.tsx',
'**/*.test.js',
'x-pack/test/apm_api_integration/**/*.ts',
'x-pack/test/functional/apps/**/*.js',
'x-pack/plugins/apm/**/*.js',
Expand All @@ -506,6 +507,7 @@ module.exports = {
],
rules: {
'import/no-default-export': 'off',
'import/no-named-as-default-member': 'off',
'import/no-named-as-default': 'off',
},
},
Expand Down Expand Up @@ -1547,8 +1549,8 @@ module.exports = {
plugins: ['react', '@typescript-eslint'],
files: ['x-pack/plugins/osquery/**/*.{js,mjs,ts,tsx}'],
rules: {
'arrow-body-style': ['error', 'as-needed'],
'prefer-arrow-callback': 'error',
// 'arrow-body-style': ['error', 'as-needed'],
// 'prefer-arrow-callback': 'error',
'no-unused-vars': 'off',
'react/prop-types': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
Expand Down
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@
"devDependencies": {
"@babel/cli": "^7.15.7",
"@babel/core": "^7.15.5",
"@babel/eslint-parser": "^7.15.7",
"@babel/eslint-plugin": "^7.14.5",
"@babel/generator": "^7.15.4",
"@babel/parser": "^7.15.7",
"@babel/plugin-proposal-class-properties": "^7.14.5",
Expand Down Expand Up @@ -518,7 +520,7 @@
"@types/ejs": "^3.0.6",
"@types/elasticsearch": "^5.0.33",
"@types/enzyme": "^3.10.8",
"@types/eslint": "^6.1.3",
"@types/eslint": "^7.28.0",
"@types/extract-zip": "^1.6.2",
"@types/faker": "^5.1.5",
"@types/fancy-log": "^1.3.1",
Expand Down Expand Up @@ -640,9 +642,9 @@
"@types/xml2js": "^0.4.5",
"@types/yauzl": "^2.9.1",
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"@typescript-eslint/typescript-estree": "^4.14.1",
"@typescript-eslint/eslint-plugin": "^4.31.2",
"@typescript-eslint/parser": "^4.31.2",
"@typescript-eslint/typescript-estree": "^4.31.2",
"@yarnpkg/lockfile": "^1.1.0",
"abab": "^2.0.4",
"aggregate-error": "^3.1.0",
Expand All @@ -653,7 +655,6 @@
"argsplit": "^1.0.5",
"autoprefixer": "^9.7.4",
"axe-core": "^4.0.2",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.2",
"babel-plugin-add-module-exports": "^1.0.4",
Expand Down Expand Up @@ -690,26 +691,25 @@
"enzyme-adapter-react-16": "^1.15.6",
"enzyme-adapter-utils": "^1.14.0",
"enzyme-to-json": "^3.6.1",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.15.0",
"eslint-import-resolver-node": "0.3.2",
"eslint-import-resolver-webpack": "0.11.1",
"eslint-module-utils": "2.5.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-ban": "^1.4.0",
"eslint-plugin-cypress": "^2.11.3",
"eslint": "^7.32.0",
"eslint-config-prettier": "^7.2.0",
"eslint-import-resolver-node": "^0.3.6",
"eslint-import-resolver-webpack": "^0.13.1",
"eslint-module-utils": "^2.6.2",
"eslint-plugin-ban": "^1.5.2",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.4",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-mocha": "^6.2.2",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.5.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-mocha": "^9.0.0",
"eslint-plugin-no-unsanitized": "^3.1.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-react": "^7.20.3",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-perf": "^3.2.3",
"eslint-plugin-react-perf": "^3.3.0",
"eslint-traverse": "^1.0.0",
"expose-loader": "^0.7.5",
"faker": "^5.1.0",
Expand Down
8 changes: 6 additions & 2 deletions packages/elastic-eslint-config-kibana/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ module.exports = {
*/
{
files: ['**/*.js'],
parser: require.resolve('babel-eslint'),
parser: require.resolve('@babel/eslint-parser'),

plugins: [
'mocha',
'babel',
'@babel',
'import',
'no-unsanitized',
'prefer-object-spread',
Expand All @@ -36,6 +36,10 @@ module.exports = {
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018,
requireConfigFile: false,
babelOptions: {
presets: ['@kbn/babel-preset/node_preset']
},
},

rules: {
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-config-schema/src/byte_size_value/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class ByteSizeValue {
return new ByteSizeValue(number);
}

const value = parseInt(match[1], 0);
const value = parseInt(match[1], 10);
const unit = match[2];

return new ByteSizeValue(value * unitMultiplier[unit]);
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-config-schema/src/duration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function stringToDuration(text: string) {
return numberToDuration(number);
}

const count = parseInt(result[1], 0);
const count = parseInt(result[1], 10);
const unit = result[2] as DurationInputArg2;

return momentDuration(count, unit);
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-eslint-plugin-eslint/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NPM_MODULE_EXTRA_FILES = [
]

DEPS = [
"@npm//babel-eslint",
"@npm//@babel/eslint-parser",
"@npm//dedent",
"@npm//eslint",
"@npm//eslint-module-utils",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

const babelEslint = require('babel-eslint');
const babelEslint = require('@babel/eslint-parser');

const { assert, normalizeWhitespace, init } = require('../lib');

Expand Down Expand Up @@ -38,7 +38,7 @@ module.exports = {
assert(!!licenses, '"licenses" option is required');

return licenses.map((license, i) => {
const parsed = babelEslint.parse(license);
const parsed = babelEslint.parse(license, { requireConfigFile: false });

assert(
!parsed.body.length,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ const rule = require('./disallow_license_headers');
const dedent = require('dedent');

const ruleTester = new RuleTester({
parser: require.resolve('babel-eslint'),
parser: require.resolve('@babel/eslint-parser'),
parserOptions: {
ecmaVersion: 2018,
requireConfigFile: false,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ const rule = require('./module_migration');
const dedent = require('dedent');

const ruleTester = new RuleTester({
parser: require.resolve('babel-eslint'),
parser: require.resolve('@babel/eslint-parser'),
parserOptions: {
ecmaVersion: 2018,
requireConfigFile: false,
},
});

Expand Down Expand Up @@ -69,6 +70,12 @@ ruleTester.run('@kbn/eslint/module-migration', rule, {
message: 'Re-exported module "foo" should be "bar"',
},
],
output: dedent`
import 'bar'
require('bar/foo2')
export { foo } from 'bar'
export const foo2 = 'bar'
`,
},
],
});
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ const { RuleTester } = require('eslint');
const rule = require('./no_restricted_paths');

const ruleTester = new RuleTester({
parser: require.resolve('babel-eslint'),
parser: require.resolve('@babel/eslint-parser'),
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018,
requireConfigFile: false,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

const babelEslint = require('babel-eslint');
const babelEslint = require('@babel/eslint-parser');

const { assert, normalizeWhitespace, init } = require('../lib');

Expand Down Expand Up @@ -38,7 +38,7 @@ module.exports = {

assert(!!license, '"license" option is required');

const parsed = babelEslint.parse(license);
const parsed = babelEslint.parse(license, { requireConfigFile: false });
assert(!parsed.body.length, '"license" option must only include a single comment');
assert(
parsed.comments.length === 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ const rule = require('./require_license_header');
const dedent = require('dedent');

const ruleTester = new RuleTester({
parser: require.resolve('babel-eslint'),
parser: require.resolve('@babel/eslint-parser'),
parserOptions: {
ecmaVersion: 2018,
requireConfigFile: false,
},
});

Expand Down
Loading