Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

tsconfig.json excludes should win over paths #3623

Closed
jamesarosen opened this issue Jan 5, 2018 · 3 comments
Closed

tsconfig.json excludes should win over paths #3623

jamesarosen opened this issue Jan 5, 2018 · 3 comments

Comments

@jamesarosen
Copy link

jamesarosen commented Jan 5, 2018

Bug Report

  • TSLint version: 5.8.0
  • TypeScript version: 2.6.2
  • Running TSLint via: CLI

TypeScript code being linted

asn1.js

with tsconfig.json:

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "target": "es2017",
    "allowJs": true,
    "moduleResolution": "node",
    "noEmitOnError": false,
    "noEmit": true,
    "sourceMap": true,
    "baseUrl": ".",
    "module": "es6",
    "paths": {
      "npm:asn1js": [ "node_modules/asn1js" ],
    }
  },
  "exclude": [
    "tmp",
    "dist",
    "node_modules"
  ]
}

with tslint.json configuration:

{
  "extends": [
    "tslint:recommended"
  ]
}

Actual behavior

Running

$ node_modules/.bin/tslint --project tsconfig.json

I get

ERROR: /code/my_project/node_modules/asn1js/build/asn1.js[8, 5]: variable name must be in lowerCamelCase, PascalCase or UPPER_CASE
ERROR: /code/my_project/node_modules/asn1js/build/asn1.js[8, 55]: if statements must be braced
ERROR: /code/my_project/node_modules/asn1js/build/asn1.js[10, 5]: variable name must be in lowerCamelCase, PascalCase or UPPER_CASE
ERROR: /code/my_project/node_modules/asn1js/build/asn1.js[10, 233]: if statements must be braced
...

Expected behavior

I expect tslint to obey the exclude: [ "node_modules" ]. If I remove the "npm:asn1js" entry from paths, I get no tslint errors.

@jamesarosen jamesarosen changed the title tsconfig.json paths wins over excludes tsconfig.json excludes should win over paths Jan 5, 2018
@jamesarosen
Copy link
Author

jamesarosen commented Jan 5, 2018

I've also tried

// tsconfig.json
{
  "exclude": [
    "node_modules",
    "node_modules/**/*.{j,t}s"
  ]
}

and

// tsconfig.json
{
  "linterOptions": {
    "exclude": [
      "node_modules/**/*.{j,t}s"
    ]
  }
}

to no avail.

If I run

node_modules/.bin/tslint --project tsconfig.json --exclude "node_modules/**/*.{j,t}s"

it works great.

@JoshuaKGoldberg
Copy link
Contributor

💀 It's time! 💀

TSLint is being deprecated and no longer accepting pull requests for major new changes or features. See #4534. 😱

If you'd like to see this change implemented, you have two choices:

  • Recommended: Check if this is available in ESLint + typescript-eslint
  • Not Recommended: Fork TSLint locally 🤷‍♂️

👋 It was a pleasure open sourcing with you!

If you believe this message was posted here in error, please comment so we can re-open the issue!

@JoshuaKGoldberg
Copy link
Contributor

🤖 Beep boop! 👉 TSLint is deprecated 👈 (#4534) and you should switch to typescript-eslint! 🤖

🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋

@palantir palantir locked and limited conversation to collaborators Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants