@fimbul/wotan
Advanced tools
Comparing version 0.2.0-dev.20180218 to 0.2.0-dev.20180220
{ | ||
"name": "@fimbul/wotan", | ||
"version": "0.2.0-dev.20180218", | ||
"version": "0.2.0-dev.20180220", | ||
"description": "Pluggable TypeScript and JavaScript linter", | ||
@@ -5,0 +5,0 @@ "bin": "bin/main.js", |
@@ -15,2 +15,28 @@ # wotan | ||
## Quick Start | ||
Install Wotan as a local dependency: | ||
```sh | ||
npm install --save-dev @fimbul/wotan | ||
# or | ||
yarn add -D @fimbult/wotan | ||
``` | ||
Add a `.wotanrc.yaml` file to the root of your project with the following content: | ||
```yaml | ||
extends: wotan:recommended | ||
``` | ||
That enables all recommended builtin rules. See the below for a list of [available rules](#available-rules) and [how the configuration works](#configuration). | ||
Now you can run the linter with one of the following commands depending on your use case: | ||
```sh | ||
wotan -p <path/to/tsconfig.json> # lint the whole project | ||
wotan "src/**/*.ts" -e "**/*.d.ts" # lint all typescript files excluding declaration files | ||
wotan --fix # lint the whole project and fix all fixable errors | ||
``` | ||
## Available Rules | ||
@@ -30,2 +56,3 @@ | ||
`no-useless-assertion` | Detects type assertions that don't change the type or are not necessary in the first place. *requires type information* | TSLint's `no-unnecessary-type-assertion` does not detect assertions needed to silence the compiler warning `Variable ... is used before being assigned.` This one also checks if the assertion is necessary at all. | ||
`no-useless-initializer` | Detects unnecessary initialization with `undefined`. | TSLint's rule `no-unnecessary-initializer` doesn't fix all parameter initializers and gives false positives for destructuring. | ||
`syntaxcheck` | Reports syntax errors as lint errors. This rule is **not** enabled in `wotan:recommended`. *requires type information* | Used to be part of the deprecated `tslint --type-check` | ||
@@ -108,2 +135,9 @@ `trailing-newline` | Requires a line break at the end of each file. | Nothing fancy here :( | ||
### Display Configuration | ||
If the linter behaves somehow unexpected, it's probably because you configured it that way. | ||
You're lucky because there's a builtin command to diagnose this, so you don't need to know how the configuration file lookup and the handling of overrides, excludes and aliases works in detail. | ||
Just use `wotan show <filename>` to display the configuration file and the exact rule config used to lint this file. If there is no file found or the file is excluded, you will see that too. | ||
## Enable or disable rules with comments | ||
@@ -144,4 +178,9 @@ | ||
## Diagnosing Misbehavior | ||
Catching bugs by just looking at an exception is hard. That's why Wotan produces debug output for certain events. You only need to enable it via environment variable `DEBUG=wotan:*` and run the previous command again. | ||
See the [detailed documentation](https://github.com/visionmedia/debug#wildcards) on how to use the wildcards. | ||
## License | ||
Apache-2.0 © [Klaus Meinhardt](https://github.com/ajafff) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
367875
145
4720
183