kibana/.eslintrc.js

443 lines
12 KiB
JavaScript
Raw Normal View History

2018-04-20 21:13:41 +02:00
const { resolve } = require('path');
const { readdirSync } = require('fs');
const dedent = require('dedent');
[6.x] Chore: canvas in xpack 6x (#22695) (#23201) * chore: merge canavs into x-pack squashed, since 6.x history isn't important and i want to be able to rebase... * chore: eslint fixes in canvas adds license headers and includes project linting overrides * Chore: Reorg the x-pack gulp tasks (#22785) - Removes deprecated, non-functional lint scripts - Removes some unused (and barely used) dependencies - Replaces deprecated `gulp-util` dependency - Adds eslint rule to prevent future use of deprecated `gulp-util` dependency - Moves all gulp tasks into `tasks` path - Moves `gulp_helpers` into `tasks/helpers` - All tasks in `gulpfile.js` were moved into `tasks` and broken up by domain This is basically a no-op moving files around PR. All the existing tasks appear to work the same with these changes. <img width="334" alt="screenshot 2018-09-06 15 42 45" src="https://user-images.githubusercontent.com/404731/45188971-8618c000-b1eb-11e8-9b26-b072ccc7ddb7.png"> * chore: rename files to match rules * chore: copy canvas dependencies * chore: reduce package.json to essentials * chore: make canvas work in xpack * chore: make browser tests work * chore: fix include paths node_modules is in a different relative path * chore: fix ml tests with canvas code in x-pack explicitely enable state management so the mlStateFactory tests pass * chore: fix RBAC tests with canvas * chore: split up the xpack prepare scripts * chore: canvas tasks - dev, peg, and plugins get dev, peg, and plugin building tasks working * chore: canvas tasks - local tests * chore: additional file cleanup * chore: yarn lockfiles and eslint fixes license headers and some small formatting stuff
2018-09-15 01:26:56 +02:00
const restrictedModules = { paths: ['gulp-util'] };
module.exports = {
extends: ['@elastic/eslint-config-kibana', '@elastic/eslint-config-kibana/jest'],
settings: {
'import/resolver': {
'@kbn/eslint-import-resolver-kibana': {
forceNode: true,
},
},
react: {
version: '16.3',
},
},
[6.x] Chore: canvas in xpack 6x (#22695) (#23201) * chore: merge canavs into x-pack squashed, since 6.x history isn't important and i want to be able to rebase... * chore: eslint fixes in canvas adds license headers and includes project linting overrides * Chore: Reorg the x-pack gulp tasks (#22785) - Removes deprecated, non-functional lint scripts - Removes some unused (and barely used) dependencies - Replaces deprecated `gulp-util` dependency - Adds eslint rule to prevent future use of deprecated `gulp-util` dependency - Moves all gulp tasks into `tasks` path - Moves `gulp_helpers` into `tasks/helpers` - All tasks in `gulpfile.js` were moved into `tasks` and broken up by domain This is basically a no-op moving files around PR. All the existing tasks appear to work the same with these changes. <img width="334" alt="screenshot 2018-09-06 15 42 45" src="https://user-images.githubusercontent.com/404731/45188971-8618c000-b1eb-11e8-9b26-b072ccc7ddb7.png"> * chore: rename files to match rules * chore: copy canvas dependencies * chore: reduce package.json to essentials * chore: make canvas work in xpack * chore: make browser tests work * chore: fix include paths node_modules is in a different relative path * chore: fix ml tests with canvas code in x-pack explicitely enable state management so the mlStateFactory tests pass * chore: fix RBAC tests with canvas * chore: split up the xpack prepare scripts * chore: canvas tasks - dev, peg, and plugins get dev, peg, and plugin building tasks working * chore: canvas tasks - local tests * chore: additional file cleanup * chore: yarn lockfiles and eslint fixes license headers and some small formatting stuff
2018-09-15 01:26:56 +02:00
rules: {
'no-restricted-imports': [2, restrictedModules],
'no-restricted-modules': [2, restrictedModules],
},
overrides: [
2018-04-20 21:13:41 +02:00
/**
* Prettier
*/
{
files: [
'.eslintrc.js',
'packages/kbn-config-schema/**/*',
'packages/kbn-pm/**/*',
'packages/kbn-es/**/*',
'packages/kbn-datemath/**/*.js',
'packages/kbn-dev-utils/**/*',
'packages/kbn-i18n/**/*',
'packages/kbn-plugin-generator/**/*',
'packages/kbn-test/**/*',
'packages/kbn-eslint-import-resolver-kibana/**/*',
2018-04-20 21:13:41 +02:00
'x-pack/plugins/apm/**/*',
],
plugins: ['prettier'],
rules: Object.assign(
2018-04-20 21:13:41 +02:00
{
'prettier/prettier': ['error'],
},
require('eslint-config-prettier').rules,
require('eslint-config-prettier/react').rules
),
},
2018-04-20 21:13:41 +02:00
/**
* Allow default exports
*/
{
2018-04-20 21:13:41 +02:00
files: ['x-pack/test/functional/apps/**/*', 'x-pack/plugins/apm/**/*'],
rules: {
2018-04-20 21:13:41 +02:00
'kibana-custom/no-default-export': 'off',
'import/no-named-as-default': 'off',
},
},
2018-04-20 21:13:41 +02:00
/**
* Files that are allowed to import webpack-specific stuff
*/
{
2018-04-20 21:13:41 +02:00
files: [
'**/public/**',
'**/webpackShims/**',
'packages/kbn-ui-framework/doc_site/src/**',
'src/fixtures/**', // TODO: this directory needs to be more obviously "public" (or go away)
],
2018-04-20 21:13:41 +02:00
settings: {
// instructs import/no-extraneous-dependencies to treat modules
// in plugins/ or ui/ namespace as "core modules" so they don't
// trigger failures for not being listed in package.json
'import/core-modules': ['plugins', 'ui', 'uiExports'],
2018-04-20 21:13:41 +02:00
'import/resolver': {
'@kbn/eslint-import-resolver-kibana': {
forceNode: false,
2018-04-20 21:13:41 +02:00
rootPackageName: 'kibana',
kibanaPath: '.',
pluginMap: readdirSync(resolve(__dirname, 'x-pack/plugins')).reduce((acc, name) => {
if (!name.startsWith('_')) {
acc[name] = `x-pack/plugins/${name}`;
}
return acc;
}, {}),
2018-04-20 21:13:41 +02:00
},
},
},
},
/**
[6.x] Validate current node version (#19154) (#19452) * Validate current node version (#19154) * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * fix(12976): remove one level from ts node register cache directory link. * chore(12976): added caret to semver dependecy in order to support minor versions. * refact(12976): small change from named import to default import on node version validator. * refact(12976): removed ts_node_register and add the code to babel_register. * feat(12976): split eslint config in order to properly support files built to run before and after node version validator. refact(12976): convert script files to es5 code. refact(12976): delete inline eslint configs from node version check related files. * refact(12976): remove ts node register file. * refact(12976): completely port setup_node_env to es5. * refact(12976): remove babel_register invokation from external dependencies in scripts. * refact(12976): move node_version code directly into node_version_validator inside setup_node_env folder. * refact(12976): only node version validator for kbn script. * Fix check_file_casing babel_register reference (#19457) * chore(12976): fixed license headers on new files.
2018-05-29 22:59:42 +02:00
* Files that ARE NOT allowed to use devDependencies
2018-04-20 21:13:41 +02:00
*/
{
files: ['packages/kbn-ui-framework/**/*', 'x-pack/**/*'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: false,
peerDependencies: true,
},
],
},
},
2018-04-20 21:13:41 +02:00
/**
[6.x] Validate current node version (#19154) (#19452) * Validate current node version (#19154) * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * fix(12976): remove one level from ts node register cache directory link. * chore(12976): added caret to semver dependecy in order to support minor versions. * refact(12976): small change from named import to default import on node version validator. * refact(12976): removed ts_node_register and add the code to babel_register. * feat(12976): split eslint config in order to properly support files built to run before and after node version validator. refact(12976): convert script files to es5 code. refact(12976): delete inline eslint configs from node version check related files. * refact(12976): remove ts node register file. * refact(12976): completely port setup_node_env to es5. * refact(12976): remove babel_register invokation from external dependencies in scripts. * refact(12976): move node_version code directly into node_version_validator inside setup_node_env folder. * refact(12976): only node version validator for kbn script. * Fix check_file_casing babel_register reference (#19457) * chore(12976): fixed license headers on new files.
2018-05-29 22:59:42 +02:00
* Files that ARE allowed to use devDependencies
2018-04-20 21:13:41 +02:00
*/
{
files: [
'packages/kbn-ui-framework/**/*.test.js',
'packages/kbn-ui-framework/doc_site/**/*',
'packages/kbn-ui-framework/generator-kui/**/*',
'packages/kbn-ui-framework/Gruntfile.js',
'packages/kbn-es/src/**/*',
[6.x] Chore: canvas in xpack 6x (#22695) (#23201) * chore: merge canavs into x-pack squashed, since 6.x history isn't important and i want to be able to rebase... * chore: eslint fixes in canvas adds license headers and includes project linting overrides * Chore: Reorg the x-pack gulp tasks (#22785) - Removes deprecated, non-functional lint scripts - Removes some unused (and barely used) dependencies - Replaces deprecated `gulp-util` dependency - Adds eslint rule to prevent future use of deprecated `gulp-util` dependency - Moves all gulp tasks into `tasks` path - Moves `gulp_helpers` into `tasks/helpers` - All tasks in `gulpfile.js` were moved into `tasks` and broken up by domain This is basically a no-op moving files around PR. All the existing tasks appear to work the same with these changes. <img width="334" alt="screenshot 2018-09-06 15 42 45" src="https://user-images.githubusercontent.com/404731/45188971-8618c000-b1eb-11e8-9b26-b072ccc7ddb7.png"> * chore: rename files to match rules * chore: copy canvas dependencies * chore: reduce package.json to essentials * chore: make canvas work in xpack * chore: make browser tests work * chore: fix include paths node_modules is in a different relative path * chore: fix ml tests with canvas code in x-pack explicitely enable state management so the mlStateFactory tests pass * chore: fix RBAC tests with canvas * chore: split up the xpack prepare scripts * chore: canvas tasks - dev, peg, and plugins get dev, peg, and plugin building tasks working * chore: canvas tasks - local tests * chore: additional file cleanup * chore: yarn lockfiles and eslint fixes license headers and some small formatting stuff
2018-09-15 01:26:56 +02:00
'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*',
2018-04-20 21:13:41 +02:00
'x-pack/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*',
'x-pack/**/*.test.js',
'x-pack/gulpfile.js',
'x-pack/plugins/apm/public/utils/testHelpers.js',
],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
peerDependencies: true,
},
],
},
},
2018-04-20 21:13:41 +02:00
/**
[6.x] Validate current node version (#19154) (#19452) * Validate current node version (#19154) * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * fix(12976): remove one level from ts node register cache directory link. * chore(12976): added caret to semver dependecy in order to support minor versions. * refact(12976): small change from named import to default import on node version validator. * refact(12976): removed ts_node_register and add the code to babel_register. * feat(12976): split eslint config in order to properly support files built to run before and after node version validator. refact(12976): convert script files to es5 code. refact(12976): delete inline eslint configs from node version check related files. * refact(12976): remove ts node register file. * refact(12976): completely port setup_node_env to es5. * refact(12976): remove babel_register invokation from external dependencies in scripts. * refact(12976): move node_version code directly into node_version_validator inside setup_node_env folder. * refact(12976): only node version validator for kbn script. * Fix check_file_casing babel_register reference (#19457) * chore(12976): fixed license headers on new files.
2018-05-29 22:59:42 +02:00
* Files that run BEFORE node version check
*/
{
files: ['scripts/**/*', 'src/setup_node_env/**/*'],
rules: {
'import/no-commonjs': 'off',
'prefer-object-spread/prefer-object-spread': 'off',
'no-var': 'off',
'prefer-const': 'off',
'prefer-destructuring': 'off',
'no-restricted-syntax': [
'error',
'ImportDeclaration',
'ExportNamedDeclaration',
'ExportDefaultDeclaration',
'ExportAllDeclaration',
'ArrowFunctionExpression',
'AwaitExpression',
'ClassDeclaration',
'RestElement',
'SpreadElement',
'YieldExpression',
'VariableDeclaration[kind="const"]',
'VariableDeclaration[kind="let"]',
'VariableDeclarator[id.type="ArrayPattern"]',
'VariableDeclarator[id.type="ObjectPattern"]',
],
},
},
/**
* Files that run AFTER node version check
* and are not also transpiled with babel
2018-04-20 21:13:41 +02:00
*/
{
files: [
'.eslintrc.js',
'**/webpackShims/**/*',
'packages/kbn-plugin-generator/**/*',
'packages/kbn-plugin-helpers/**/*',
'packages/kbn-eslint-import-resolver-kibana/**/*',
'packages/kbn-eslint-plugin-license-header/**/*',
'x-pack/gulpfile.js',
'x-pack/dev-tools/mocha/setup_mocha.js',
'x-pack/scripts/*',
],
rules: {
'import/no-commonjs': 'off',
'prefer-object-spread/prefer-object-spread': 'off',
'no-restricted-syntax': [
'error',
'ImportDeclaration',
'ExportNamedDeclaration',
'ExportDefaultDeclaration',
'ExportAllDeclaration',
],
},
},
/**
* Files that require Apache 2.0 headers, settings
2018-06-28 05:50:06 +02:00
* are overridden below for files that require Elastic
* Licence headers
*/
{
files: ['**/*.js'],
plugins: ['@kbn/eslint-plugin-license-header'],
rules: {
'@kbn/license-header/require-license-header': [
'error',
{
license: dedent`
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
`,
},
],
},
},
2018-04-20 21:13:41 +02:00
/**
* X-Pack global overrides
*/
{
files: ['x-pack/**/*'],
rules: {
quotes: 'off',
},
},
/**
* Files that require Elastic license headers instead of Apache 2.0 header
2018-04-20 21:13:41 +02:00
*/
{
files: ['x-pack/**/*.js'],
plugins: ['@kbn/eslint-plugin-license-header'],
rules: {
'@kbn/license-header/require-license-header': [
'error',
{
license: dedent`
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
`,
},
],
},
},
/**
* APM overrides
*/
{
files: ['x-pack/plugins/apm/**/*'],
rules: {
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-console': ['warn', { allow: ['error'] }],
},
},
/**
* Graph overrides
*/
{
files: ['x-pack/plugins/graph/**/*'],
globals: {
angular: true,
$: true,
},
rules: {
'block-scoped-var': 'off',
camelcase: 'off',
eqeqeq: 'off',
'guard-for-in': 'off',
'new-cap': 'off',
'no-loop-func': 'off',
'no-redeclare': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'one-var': 'off',
},
},
/**
* ML overrides
*/
{
files: ['x-pack/plugins/ml/**/*'],
rules: {
quotes: 'error',
'no-shadow': 'error',
},
},
/**
* Monitoring overrides
*/
{
files: ['x-pack/plugins/monitoring/**/*'],
rules: {
'block-spacing': ['error', 'always'],
curly: ['error', 'all'],
'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }],
'no-else-return': 'error',
},
},
{
files: ['x-pack/plugins/monitoring/public/**/*'],
env: { browser: true },
},
[6.x] Chore: canvas in xpack 6x (#22695) (#23201) * chore: merge canavs into x-pack squashed, since 6.x history isn't important and i want to be able to rebase... * chore: eslint fixes in canvas adds license headers and includes project linting overrides * Chore: Reorg the x-pack gulp tasks (#22785) - Removes deprecated, non-functional lint scripts - Removes some unused (and barely used) dependencies - Replaces deprecated `gulp-util` dependency - Adds eslint rule to prevent future use of deprecated `gulp-util` dependency - Moves all gulp tasks into `tasks` path - Moves `gulp_helpers` into `tasks/helpers` - All tasks in `gulpfile.js` were moved into `tasks` and broken up by domain This is basically a no-op moving files around PR. All the existing tasks appear to work the same with these changes. <img width="334" alt="screenshot 2018-09-06 15 42 45" src="https://user-images.githubusercontent.com/404731/45188971-8618c000-b1eb-11e8-9b26-b072ccc7ddb7.png"> * chore: rename files to match rules * chore: copy canvas dependencies * chore: reduce package.json to essentials * chore: make canvas work in xpack * chore: make browser tests work * chore: fix include paths node_modules is in a different relative path * chore: fix ml tests with canvas code in x-pack explicitely enable state management so the mlStateFactory tests pass * chore: fix RBAC tests with canvas * chore: split up the xpack prepare scripts * chore: canvas tasks - dev, peg, and plugins get dev, peg, and plugin building tasks working * chore: canvas tasks - local tests * chore: additional file cleanup * chore: yarn lockfiles and eslint fixes license headers and some small formatting stuff
2018-09-15 01:26:56 +02:00
/**
* Canvas overrides
*/
{
files: ['x-pack/plugins/canvas/**/*'],
plugins: ['prettier'],
rules: {
// preferences
'comma-dangle': [2, 'always-multiline'],
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 1 }],
'no-multi-spaces': 2,
radix: 2,
curly: [2, 'multi-or-nest', 'consistent'],
// annoying rules that conflict with prettier
'space-before-function-paren': 0,
indent: 0,
'wrap-iife': 0,
'max-len': 0,
// module importing
'import/order': [
2,
{ groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'] },
],
'import/extensions': [2, 'never', { json: 'always', less: 'always', svg: 'always' }],
// prettier
'prettier/prettier': 2,
// react
'jsx-quotes': 2,
'react/no-did-mount-set-state': 2,
'react/no-did-update-set-state': 2,
'react/no-multi-comp': [2, { ignoreStateless: true }],
'react/self-closing-comp': 2,
'react/sort-comp': 2,
'react/jsx-boolean-value': 2,
'react/jsx-wrap-multilines': 2,
'react/no-unescaped-entities': [2, { forbid: ['>', '}'] }],
'react/forbid-elements': [
2,
{
forbid: [
{
element: 'EuiConfirmModal',
message: 'Use <ConfirmModal> instead',
},
{
element: 'EuiPopover',
message: 'Use <Popover> instead',
},
{
element: 'EuiIconTip',
message: 'Use <TooltipIcon> instead',
},
],
},
],
},
},
{
files: ['x-pack/plugins/canvas/*', 'x-pack/plugins/canvas/**/*'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: './x-pack/',
[6.x] Chore: canvas in xpack 6x (#22695) (#23201) * chore: merge canavs into x-pack squashed, since 6.x history isn't important and i want to be able to rebase... * chore: eslint fixes in canvas adds license headers and includes project linting overrides * Chore: Reorg the x-pack gulp tasks (#22785) - Removes deprecated, non-functional lint scripts - Removes some unused (and barely used) dependencies - Replaces deprecated `gulp-util` dependency - Adds eslint rule to prevent future use of deprecated `gulp-util` dependency - Moves all gulp tasks into `tasks` path - Moves `gulp_helpers` into `tasks/helpers` - All tasks in `gulpfile.js` were moved into `tasks` and broken up by domain This is basically a no-op moving files around PR. All the existing tasks appear to work the same with these changes. <img width="334" alt="screenshot 2018-09-06 15 42 45" src="https://user-images.githubusercontent.com/404731/45188971-8618c000-b1eb-11e8-9b26-b072ccc7ddb7.png"> * chore: rename files to match rules * chore: copy canvas dependencies * chore: reduce package.json to essentials * chore: make canvas work in xpack * chore: make browser tests work * chore: fix include paths node_modules is in a different relative path * chore: fix ml tests with canvas code in x-pack explicitely enable state management so the mlStateFactory tests pass * chore: fix RBAC tests with canvas * chore: split up the xpack prepare scripts * chore: canvas tasks - dev, peg, and plugins get dev, peg, and plugin building tasks working * chore: canvas tasks - local tests * chore: additional file cleanup * chore: yarn lockfiles and eslint fixes license headers and some small formatting stuff
2018-09-15 01:26:56 +02:00
},
],
},
},
{
files: [
'x-pack/plugins/canvas/gulpfile.js',
'x-pack/plugins/canvas/tasks/*.js',
'x-pack/plugins/canvas/tasks/**/*.js',
'x-pack/plugins/canvas/__tests__/**/*',
'x-pack/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*',
],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
peerDependencies: true,
packageDir: './x-pack/',
[6.x] Chore: canvas in xpack 6x (#22695) (#23201) * chore: merge canavs into x-pack squashed, since 6.x history isn't important and i want to be able to rebase... * chore: eslint fixes in canvas adds license headers and includes project linting overrides * Chore: Reorg the x-pack gulp tasks (#22785) - Removes deprecated, non-functional lint scripts - Removes some unused (and barely used) dependencies - Replaces deprecated `gulp-util` dependency - Adds eslint rule to prevent future use of deprecated `gulp-util` dependency - Moves all gulp tasks into `tasks` path - Moves `gulp_helpers` into `tasks/helpers` - All tasks in `gulpfile.js` were moved into `tasks` and broken up by domain This is basically a no-op moving files around PR. All the existing tasks appear to work the same with these changes. <img width="334" alt="screenshot 2018-09-06 15 42 45" src="https://user-images.githubusercontent.com/404731/45188971-8618c000-b1eb-11e8-9b26-b072ccc7ddb7.png"> * chore: rename files to match rules * chore: copy canvas dependencies * chore: reduce package.json to essentials * chore: make canvas work in xpack * chore: make browser tests work * chore: fix include paths node_modules is in a different relative path * chore: fix ml tests with canvas code in x-pack explicitely enable state management so the mlStateFactory tests pass * chore: fix RBAC tests with canvas * chore: split up the xpack prepare scripts * chore: canvas tasks - dev, peg, and plugins get dev, peg, and plugin building tasks working * chore: canvas tasks - local tests * chore: additional file cleanup * chore: yarn lockfiles and eslint fixes license headers and some small formatting stuff
2018-09-15 01:26:56 +02:00
},
],
},
},
{
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*'],
globals: { canvas: true, $: true },
rules: {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: './x-pack/',
[6.x] Chore: canvas in xpack 6x (#22695) (#23201) * chore: merge canavs into x-pack squashed, since 6.x history isn't important and i want to be able to rebase... * chore: eslint fixes in canvas adds license headers and includes project linting overrides * Chore: Reorg the x-pack gulp tasks (#22785) - Removes deprecated, non-functional lint scripts - Removes some unused (and barely used) dependencies - Replaces deprecated `gulp-util` dependency - Adds eslint rule to prevent future use of deprecated `gulp-util` dependency - Moves all gulp tasks into `tasks` path - Moves `gulp_helpers` into `tasks/helpers` - All tasks in `gulpfile.js` were moved into `tasks` and broken up by domain This is basically a no-op moving files around PR. All the existing tasks appear to work the same with these changes. <img width="334" alt="screenshot 2018-09-06 15 42 45" src="https://user-images.githubusercontent.com/404731/45188971-8618c000-b1eb-11e8-9b26-b072ccc7ddb7.png"> * chore: rename files to match rules * chore: copy canvas dependencies * chore: reduce package.json to essentials * chore: make canvas work in xpack * chore: make browser tests work * chore: fix include paths node_modules is in a different relative path * chore: fix ml tests with canvas code in x-pack explicitely enable state management so the mlStateFactory tests pass * chore: fix RBAC tests with canvas * chore: split up the xpack prepare scripts * chore: canvas tasks - dev, peg, and plugins get dev, peg, and plugin building tasks working * chore: canvas tasks - local tests * chore: additional file cleanup * chore: yarn lockfiles and eslint fixes license headers and some small formatting stuff
2018-09-15 01:26:56 +02:00
},
],
'import/no-unresolved': [
'error',
{
ignore: ['!!raw-loader.+.svg$'],
},
],
},
},
],
};