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

Adding file extensions to lint by default #845

Closed
eadwu opened this issue Apr 8, 2017 · 1 comment

Comments

@eadwu
Copy link

commented Apr 8, 2017

By running node_modules/standard/bin/cmd.js it only lints *.js and *.jsx as the usage information says. How would I add more file extensions, such as .ts so that it would be linted as well. Currently I use node_modules/standard/bin/cmd.js */**/*.ts. While there is nothing wrong with this, is it possible to add the file extension to package.json?

@feross

This comment has been minimized.

Copy link
Member

commented Apr 8, 2017

You should only need to use standard **/*.ts. You don't need the extra */ in front. If you're having issues, try quoting the argument so that your shell won't expand the stars. You want them to get passed into standard.

To answer your question: There is no way to add this to the "standard" field in package.json. It must be passed in as a command line argument.

Pro-tip: If you are using npm scripts, you do not need to use the full path node_modules/standard/bin/cmd.js. Instead just use standard and your local copy will be used automatically. Like this:

{
  "scripts": {
    "test": "standard **/*.ts"
  }
}

@feross feross closed this Apr 8, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.