Skip to content

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

Closed
@ziazon

Description

@ziazon

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions