Ignore file pattern to external package does not work
See original GitHub issueTell us about your environment
- ESLint Version: eslint@4.19.1
- Node Version: v10.2.1
- npm Version: 6.1.0
What parser (default, Babel-ESLint, etc.) are you using? babel-eslint
Please show your full configuration:
Configuration
.eslintrc.js
:
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
// 'plugin:vue/essential',
'plugin:vue/recommended',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
globals: {
'ga': true, // Google Analytics
'cordova': true,
'__statics': true
},
// add your custom rules here
'rules': {
// allow async-await
'generator-star-spacing': 'off',
// allow paren-less arrow functions
'arrow-parens': 0,
'one-var': 0,
'import/first': 0,
'import/named': 2,
'import/namespace': 2,
'import/default': 2,
'import/export': 2,
'import/extensions': 0,
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
I created a Quasar Framework app. It got built and work correctly.
Then I linked an external package (https://github.com/vue-generators/vue-form-generator) in package.json
:
"devDependencies": {
"babel-eslint": "^8.2.1",
"eslint": "^4.18.2",
"eslint-config-standard": "^11.0.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-html": "^4.0.3",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.3.0",
"quasar-cli": "^0.16.0",
"vue-form-generator": "link:../temp/vue-form-generator"
},
Notice the the package’s main is from the dist
directory:
$ head -n 6 ~/git/temp/vue-form-generator/package.json
{
"name": "vue-form-generator",
"version": "2.2.2",
"description": "A schema-based form generator component for Vue.js",
"homepage": "https://github.com/icebob/vue-form-generator",
"main": "dist/vfg.js",
I used the package in src/plugins/vueFormGenerator.js
:
import VueFormGenerator from 'vue-form-generator'
export default ({ app, router, Vue }) => {
Vue.use(VueFormGenerator)
}
When I ran qusar dev
I got linting issues with the linked package:
/usr/local/bin/node /Users/toshalev/git/msm-admin/node_modules/.bin/quasar dev
app:dev Running: Mode [ SPA ] with [ MAT ] theme +0ms
app:quasar-conf Reading quasar.conf.js +861ms
app:dev Checking listening address availability (0.0.0.0:8080)... +3ms
app:quasar-conf Generating Webpack config +12ms
app:quasar-conf Extending Webpack config +26ms
app:generator Generating Webpack entry point +3ms
app:dev-server Booting up... +3ms
ERROR Failed to compile with 1 errors3:45:38 PM
error in ../temp/vue-form-generator/dist/vfg.js
/Users/toshalev/git/temp/vue-form-generator/dist/vfg.js
7:112 error 'define' is not defined no-undef
7:123 error 'define' is not defined no-undef
7:212 error Missing semicolon semi
...
Apparently, lint
is applied on the external package when I import it in the code.
In order to disable linting of that package, I add the package’s main minified file to .eslintignore
:
$ cat .eslintignore
/dist
vfg.js
This works as expected, and the app builds fine.
However, and this is the bug, some patterns to match the ignored file, /Users/toshalev/git/temp/vue-form-generator/dist/vfg.js
work, and some doesn’t:
vfg.js
--> works
*/dist/*
--> does not work
*/vue-form-generator/*
--> does not work
What did you expect to happen? I expect all these patterns to work.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
I think you should use
**
instead of*
in your.eslintignore
file.@platinumazure @Aladdin-ADD Triage type suggestion:
question