Skip to content

adevnadia/stricter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stricter

Greenkeeper badge Build Status npm version

A project-wide js-linting tool

Configuration

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.

Basic Configuration

{
    "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",
                ]
            }
        }],
    }
}

Debugging

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"
        }
    ]
}

About

A project-wide js-linting tool

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 96.5%
  • JavaScript 3.5%