mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
chore: eslint fixes in canvas
adds license headers and includes project linting overrides
This commit is contained in:
parent
b85ab4defd
commit
af84ecca84
11 changed files with 128 additions and 11 deletions
|
@ -27,5 +27,8 @@ bower_components
|
|||
/x-pack/coverage
|
||||
/x-pack/build
|
||||
/x-pack/plugins/**/__tests__/fixtures/**
|
||||
/x-pack/plugins/canvas/common/lib/grammar.js
|
||||
/x-pack/plugins/canvas/canvas_plugin
|
||||
/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/*
|
||||
**/*.js.snap
|
||||
!/.eslintrc.js
|
||||
|
|
110
.eslintrc.js
110
.eslintrc.js
|
@ -330,5 +330,115 @@ module.exports = {
|
|||
files: ['x-pack/plugins/monitoring/public/**/*'],
|
||||
env: { browser: true },
|
||||
},
|
||||
|
||||
/**
|
||||
* 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: resolve(__dirname, 'x-pack/package.json'),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
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: resolve(__dirname, 'x-pack/package.json'),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*'],
|
||||
globals: { canvas: true, $: true },
|
||||
rules: {
|
||||
'import/no-extraneous-dependencies': [
|
||||
'error',
|
||||
{
|
||||
packageDir: resolve(__dirname, 'x-pack/package.json'),
|
||||
},
|
||||
],
|
||||
'import/no-unresolved': [
|
||||
'error',
|
||||
{
|
||||
ignore: ['!!raw-loader.+.svg$'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
6
x-pack/plugins/canvas/.prettierrc
Normal file
6
x-pack/plugins/canvas/.prettierrc
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"singleQuote": true,
|
||||
"semi": true,
|
||||
"printWidth": 100,
|
||||
"trailingComma": "es5"
|
||||
}
|
|
@ -10,8 +10,8 @@
|
|||
"start": "gulp dev",
|
||||
"build": "gulp build",
|
||||
"build:sass": "gulp sass",
|
||||
"fix": "gulp lint-fix",
|
||||
"lint": "gulp lint",
|
||||
"fix": "yarn run lint --fix",
|
||||
"lint": "node ../../../scripts/eslint '*.js' '__tests__/**/*.js' 'tasks/**/*.js' 'server/**/*.js' 'common/**/*.js' 'public/**/*.{js,jsx}' 'canvas_plugin_src/**/*.{js,jsx}' --ignore-pattern 'canvas/canvas_plugin_src/lib/flot-charts/**/*' --ignore-pattern 'common/lib/grammar.js' --ignore-pattern 'canvas_plugin/**/*'",
|
||||
"test": "gulp test",
|
||||
"kbn": "node ../../kibana/scripts/kbn",
|
||||
"docs": "gulp docs",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import uniqBy from 'lodash.uniqby';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import uniqBy from 'lodash.uniqby';
|
||||
import { createStore } from '../../state/store';
|
||||
import { getInitialState } from '../../state/initial_state';
|
||||
import { functionsRegistry } from '../../../common/lib/functions_registry';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { get } from 'lodash';
|
||||
import chrome from 'ui/chrome';
|
||||
import { absoluteToParsedUrl } from 'ui/url/absolute_to_parsed_url';
|
||||
import { get } from 'lodash';
|
||||
import { getWindow } from '../../lib/get_window';
|
||||
import { CANVAS_APP } from '../../../common/lib/constants';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* eslint import/no-unresolved: 1 */
|
||||
// TODO: remove eslint rule when updating to use the linked kibana resolve package
|
||||
import { jobCompletionNotifications } from 'plugins/reporting/services/job_completion_notifications';
|
||||
import { connect } from 'react-redux';
|
||||
import { compose, withProps } from 'recompose';
|
||||
import { jobCompletionNotifications } from 'plugins/reporting/services/job_completion_notifications';
|
||||
import { getWorkpad, getPages } from '../../state/selectors/workpad';
|
||||
import { getReportingBrowserType } from '../../state/selectors/app';
|
||||
import { notify } from '../../lib/notify';
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/* eslint import/no-unresolved: 1 */
|
||||
// TODO: remove eslint rule when updating to use the linked kibana resolve package
|
||||
import rison from 'rison-node';
|
||||
import chrome from 'ui/chrome';
|
||||
import { QueryString } from 'ui/utils/query_string';
|
||||
import rison from 'rison-node';
|
||||
import { fetch } from '../../../common/lib/fetch';
|
||||
|
||||
// type of the desired pdf output (print or preserve_layout)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import chrome from 'ui/chrome';
|
||||
import lzString from 'lz-string';
|
||||
import { createBrowserHistory, createMemoryHistory, parsePath, createPath } from 'history';
|
||||
import { get } from 'lodash';
|
||||
import chrome from 'ui/chrome';
|
||||
import { APP_ROUTE } from '../../common/lib/constants';
|
||||
import { getWindow } from './get_window';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import $script from 'scriptjs';
|
||||
import chrome from 'ui/chrome';
|
||||
import $script from 'scriptjs';
|
||||
import { typesRegistry } from '../../common/lib/types_registry';
|
||||
import {
|
||||
argTypeRegistry,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import io from 'socket.io-client';
|
||||
import chrome from 'ui/chrome';
|
||||
import io from 'socket.io-client';
|
||||
import { functionsRegistry } from '../common/lib/functions_registry';
|
||||
import { loadBrowserPlugins } from './lib/load_browser_plugins';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue