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:
Joe Fleming 2018-11-02 11:24:11 -06:00 committed by joe fleming
parent cc3092af29
commit b684eaae49
2 changed files with 12 additions and 19 deletions

View file

@ -345,6 +345,17 @@ module.exports = {
/**
* 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/**/*'],
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: [
'x-pack/plugins/canvas/gulpfile.js',
@ -428,7 +428,6 @@ module.exports = {
{
devDependencies: true,
peerDependencies: true,
packageDir: './x-pack/',
},
],
},
@ -437,12 +436,6 @@ module.exports = {
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*'],
globals: { canvas: true, $: true },
rules: {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: './x-pack/',
},
],
'import/no-unresolved': [
'error',
{

View file

@ -10,7 +10,7 @@
"scripts": {
"kbn": "node ../../../scripts/kbn",
"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:common": "../../node_modules/.bin/gulp canvas:test:common",
"test:server": "../../node_modules/.bin/gulp canvas:test:server",