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

Linters #25

Open
varHarrie opened this issue Oct 29, 2018 · 0 comments
Open

Linters #25

varHarrie opened this issue Oct 29, 2018 · 0 comments

Comments

@varHarrie
Copy link
Owner

varHarrie commented Oct 29, 2018

Linters

JavaScript

$ npm i -D eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node
// .eslintrc
{
  "extends": ["standard"]
}

TypeScript

$ npm i -D tslint tslint tslint-config-standard
// tslint.json
{
  "extends": [
    "tslint:latest",
    "tslint-config-standard"
  ],
  "rules": {
    "indent": [true, "spaces", 2],
    "interface-name": [true, "never-prefix"],
    "max-classes-per-file": true,
    "max-line-length": [true, 120],
    "member-ordering": [true, {"order": ["static-field", "static-method", "instance-field", "constructor", "instance-method"]}],
    "no-any": false,
    "no-empty-interface": false,
    "no-floating-promises": false,
    "no-shadowed-variable": true,
    "no-string-literal": true,
    "no-submodule-imports": false,
    "object-literal-sort-keys": false,
    "ordered-imports": false,
    "switch-default": true
  }
}

TypeScript + React

$ npm i -D tslint tslint tslint-config-standard tslint-react
// tslint.json
{
  "extends": [
    "tslint:latest",
    "tslint-config-standard",
    "tslint-react"
  ],
  "rules": {
    "indent": [true, "spaces", 2],
    "interface-name": [true, "never-prefix"],
    "jsx-boolean-value": [true, "never"],
    "jsx-no-multiline-js": false,
    "max-classes-per-file": true,
    "max-line-length": [true, 120],
    "member-ordering": [true, {"order": ["static-field", "static-method", "instance-field", "constructor", "instance-method"]}],
    "no-any": false,
    "no-empty-interface": false,
    "no-floating-promises": false,
    "no-shadowed-variable": true,
    "no-string-literal": true,
    "no-submodule-imports": false,
    "object-literal-sort-keys": false,
    "ordered-imports": false,
    "switch-default": true
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant