Skip to content

Commit

Permalink
Merge pull request desktop#6204 from desktop/no-lint-scripts
Browse files Browse the repository at this point in the history
pull eslint scripts into package.json
  • Loading branch information
shiftkey authored Nov 21, 2018
2 parents f7c63e0 + 7e40535 commit b38e078
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 40 deletions.
4 changes: 0 additions & 4 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins:
- typescript
- babel
- react
- prettier
- json

extends:
Expand Down Expand Up @@ -73,9 +72,6 @@ rules:
###########
# SPECIAL #
###########
prettier/prettier:
- error
- parser: typescript
no-restricted-syntax:
- error
# no-default-export
Expand Down
37 changes: 37 additions & 0 deletions docs/contributing/linting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Linting

[What is linting, anyways?](https://en.wikipedia.org/wiki/Lint_%28software%29)

## Tooling

Our linting tooling uses a combination of

* [Prettier](https://github.com/prettier/prettier)
* [ESLint](https://github.com/eslint/eslint)
* [TSLint](https://github.com/palantir/tslint).

Most (if not all) editors have integrations for these tools so that they will report errors and fix formatting in realtime. See [tooling](./tooling.md) for how to set these integrations up while developing for desktop.

## Running Checks

Use

```shellsession
$ yarn lint
```

in your local repository to run all linting checks. Each tool will report their errors on the command line.

## Fixing Issues

Some issues found by linters can be automatically fixed. Use

```shellsession
$ yarn lint:fix
```

to automatically fix them. If any issues remain, you'll have to fix them manually (and the output will tell you that).

## Continuous Integration (CI)

Each of our CI services also runs linting checks on [open pull requests](https://github.com/desktop/desktop/pulls) in the GitHub Desktop repository. Pull requests must pass CI to before we accept them, so don't forget to lint locally.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"lint:src": "yarn tslint && yarn eslint-check && yarn eslint",
"lint:src:fix": "yarn tslint --fix && yarn eslint --fix",
"tslint": "tslint -p .",
"eslint": "ts-node -P script/tsconfig.json script/eslint.ts",
"eslint": "eslint --cache --rulesdir ./eslint-rules \"./{script,eslint-rules,tslint-rules}/**/*.{j,t}s{,x}\" \"./app/{src,typings,test}/**/*.{j,t}s{,x}\" \"./changelog.json\"",
"eslint-check": "eslint --print-config .eslintrc.* | eslint-config-prettier-check",
"publish": "ts-node -P script/tsconfig.json script/publish.ts",
"clean-slate": "rimraf out node_modules app/node_modules coverage && yarn",
Expand Down
35 changes: 0 additions & 35 deletions script/eslint.ts

This file was deleted.

0 comments on commit b38e078

Please sign in to comment.