A project-wide js-linting tool
Stricter uses cosmiconfig for configuration. You can provide configuration via
- .stricterrc file, written in YAML or JSON, with optional extensions: .yaml/.yml/.json/.js.
- stricter.config.js file that exports an object.
- "stricter" key in your package.json file.
The configuration file will be resolved starting from the current working directory location, and searching up the file tree until a config file is (or isn't) found.
{
"root": "src",
"rulesDir": "rules",
"rules": {
"hello-world-project": {
"level": "error"
},
"all-files-project": {
"level": "warning"
},
"stricter/unused-files": [{
"level": "warning",
"include" : ".*\\\\foo\\\\.*",
"config": {
"entry": [
".*\\\\foo\\\\.*story\\.js",
".*\\\\foo\\\\\\.eslintrc\\.js",
".*\\\\foo\\\\.*spec\\.js",
".*\\\\foo\\\\.*test\\.js",
".*\\\\foo\\\\.*\\.md",
".*\\\\foo\\\\bar\\\\index\\.js",
".*\\\\foo\\\\baz\\\\index\\.js",
]
}
}],
}
}
It helps to use src/cli.ts as an entry point for debugging.
A sample launch.json for VS Code might look like
{
"version": "0.2.0",
"configurations": [
{
"name": "Current TS File",
"type": "node",
"request": "launch",
"args": ["${relativeFile}"],
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
"cwd": "${workspaceRoot}",
"protocol": "inspector"
}
]
}