Chore: fix canvas linting (#25024)
This fixes `yarn run lint` from within the Canvas plugin path. - Point to the correct eslint config file - Use absolute path for `packageDir` - Remove extraneous `packageDir` settings
This commit is contained in:
parent
cc3092af29
commit
b684eaae49
29
.eslintrc.js
29
.eslintrc.js
|
@ -345,6 +345,17 @@ module.exports = {
|
||||||
/**
|
/**
|
||||||
* Canvas overrides
|
* Canvas overrides
|
||||||
*/
|
*/
|
||||||
|
{
|
||||||
|
files: ['x-pack/plugins/canvas/*', 'x-pack/plugins/canvas/**/*'],
|
||||||
|
rules: {
|
||||||
|
'import/no-extraneous-dependencies': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
packageDir: resolve(__dirname, 'x-pack'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: ['x-pack/plugins/canvas/**/*'],
|
files: ['x-pack/plugins/canvas/**/*'],
|
||||||
plugins: ['prettier'],
|
plugins: ['prettier'],
|
||||||
|
@ -403,17 +414,6 @@ module.exports = {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
files: ['x-pack/plugins/canvas/*', 'x-pack/plugins/canvas/**/*'],
|
|
||||||
rules: {
|
|
||||||
'import/no-extraneous-dependencies': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
packageDir: './x-pack/',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
files: [
|
files: [
|
||||||
'x-pack/plugins/canvas/gulpfile.js',
|
'x-pack/plugins/canvas/gulpfile.js',
|
||||||
|
@ -428,7 +428,6 @@ module.exports = {
|
||||||
{
|
{
|
||||||
devDependencies: true,
|
devDependencies: true,
|
||||||
peerDependencies: true,
|
peerDependencies: true,
|
||||||
packageDir: './x-pack/',
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -437,12 +436,6 @@ module.exports = {
|
||||||
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*'],
|
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*'],
|
||||||
globals: { canvas: true, $: true },
|
globals: { canvas: true, $: true },
|
||||||
rules: {
|
rules: {
|
||||||
'import/no-extraneous-dependencies': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
packageDir: './x-pack/',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'import/no-unresolved': [
|
'import/no-unresolved': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"kbn": "node ../../../scripts/kbn",
|
"kbn": "node ../../../scripts/kbn",
|
||||||
"start": "../../node_modules/.bin/gulp canvas:dev",
|
"start": "../../node_modules/.bin/gulp canvas:dev",
|
||||||
"lint": "node ../../../scripts/eslint '*.js' '__tests__/**/*.js' 'tasks/**/*.js' 'server/**/*.js' 'common/**/*.js' 'public/**/*.{js,jsx}' 'canvas_plugin_src/**/*.{js,jsx}' --ignore-pattern 'canvas_plugin_src/lib/flot-charts/**/*' --ignore-pattern 'common/lib/grammar.js' --ignore-pattern 'canvas_plugin/**/*'",
|
"lint": "node ../../../scripts/eslint -c ../../../.eslintrc.js '*.js' '__tests__/**/*.js' 'tasks/**/*.js' 'server/**/*.js' 'common/**/*.js' 'public/**/*.{js,jsx}' 'canvas_plugin_src/**/*.{js,jsx}' --ignore-pattern 'canvas_plugin_src/lib/flot-charts/**/*' --ignore-pattern 'common/lib/grammar.js' --ignore-pattern 'canvas_plugin/**/*'",
|
||||||
"test": "../../node_modules/.bin/gulp canvas:test",
|
"test": "../../node_modules/.bin/gulp canvas:test",
|
||||||
"test:common": "../../node_modules/.bin/gulp canvas:test:common",
|
"test:common": "../../node_modules/.bin/gulp canvas:test:common",
|
||||||
"test:server": "../../node_modules/.bin/gulp canvas:test:server",
|
"test:server": "../../node_modules/.bin/gulp canvas:test:server",
|
||||||
|
|
Loading…
Reference in a new issue