Skip to content

Commit

Permalink
Chore: fix canvas linting (#25024)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
w33ble authored Nov 2, 2018
1 parent cd27455 commit f6fd86a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
29 changes: 11 additions & 18 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,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'],
Expand Down Expand Up @@ -406,17 +417,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',
Expand All @@ -431,7 +431,6 @@ module.exports = {
{
devDependencies: true,
peerDependencies: true,
packageDir: './x-pack/',
},
],
},
Expand All @@ -440,12 +439,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',
{
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f6fd86a

Please sign in to comment.