Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSLint: node_modules/** should be excluded by default #1194

Closed
ziazon opened this issue Apr 29, 2018 · 1 comment
Closed

TSLint: node_modules/** should be excluded by default #1194

ziazon opened this issue Apr 29, 2018 · 1 comment

Comments

@ziazon
Copy link

ziazon commented Apr 29, 2018

Version

3.0.0-beta.6

Reproduction link

https://github.com/jubairsaidi/vue_exclusion_bug

Steps to reproduce

Create a new project, and then install vue-awesome npm i vue-awesome

then in your main.ts file:

import 'vue-awesome/icons';
import Icon from 'vue-awesome/components/Icon.vue';
Vue.component('icon', Icon);

then run npm run serve

What is expected?

 DONE  Compiled successfully in 13427ms                                                                                                                                                            12:54:51 PM

No type errors found
No lint errors found
Version: typescript 2.8.3, tslint 5.9.1
Time: 7455ms

What is actually happening?

WARNING in /path/to/project/node_modules/vue-awesome/components/Icon.vue
224:41 Missing semicolon
    222 | let cursor = 0xd4937
    223 | function getId () {
  > 224 |   return `fa-${(cursor  ).toString(16)}`
        |                                         ^
    225 | }
    226 | </script>
    227 |
No type errors found
Version: typescript 2.8.3, tslint 5.9.1
Time: 6093ms

To solve this, this is what my tslint.json looks like

{
  "defaultSeverity": "warning",
  "extends": [
    "tslint:recommended"
  ],
  "linterOptions": {
      "exclude": [
          "node_modules/**"
      ]
  },
  "rules": {
    "quotemark": [true, "single"],
    "indent": [true, "spaces", 2],
    "interface-name": false,
    "ordered-imports": false,
    "object-literal-sort-keys": false,
    "no-consecutive-blank-lines": false,
    "trailing-comma": [false],
    "no-console": [false, "warn", "error"],
    "arrow-parens": [false, "as-needed"],
    "curly": [false, "as-needed"]
  }
}

As you can see, I have to explicitly add node_modules/** to the exclude list. Correct me if I'm wrong but this should not be the case, i.e. built in.

@LinusBorg LinusBorg changed the title explicite exclusion of node_modules/** should not be required. TSLint: node_modules/** should be excluded by default Apr 30, 2018
@dhensche
Copy link
Contributor

Looks like eslint ignores node_modules/** by default but tslint does not. Should be an easy fix to update the tslint plugin to match the eslint behavior

ybiquitous added a commit to ybiquitous/bem-ts that referenced this issue Jul 10, 2018
TSLint doesn't ignore `node_modules/**` by default.
By using `linterOptions` in `tslint.json`, this makes glob argument more generic.

See <vuejs/vue-cli#1194>

See also #107
ybiquitous added a commit to ybiquitous/bem-ts that referenced this issue Jul 10, 2018
…108)

TSLint doesn't ignore `node_modules/**` by default.
By using `linterOptions` in `tslint.json`, this makes glob argument more generic.

See <vuejs/vue-cli#1194>

See also #107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants