Skip to content

Commit ee247c5

Browse files
bradzacherJamesHenry
authored andcommitted
[DOCS] Add CONTRIBUTING.md, disable vscode autoformat (typescript-eslint#192)
The vscode autoformatter is completely at odds with prettier, so if you don't have the prettier extension installed, you end up with wild changes. Additionally if you've got both the beautify and prettier extensions installed, it can cause some serious issues. Forcing it to be on will probably cause a lot of headaches to anyone trying to contribute unless they get their environment setup perfectly (sorry @weirdpattern for earlier!!)
1 parent 1408dab commit ee247c5

File tree

7 files changed

+120
-58
lines changed

7 files changed

+120
-58
lines changed

Diff for: packages/eslint-plugin-typescript/.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ indent_size = 4
66
trim_trailing_whitespace = true
77
end_of_line = lf
88
insert_final_newline = true
9+
10+
# yarn / npm uses 2 spaces when it dumps the file after a change
11+
[package.json]
12+
indent_size = 2

Diff for: packages/eslint-plugin-typescript/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ versions.json
1616
yarn.lock
1717
/.vscode/*
1818
!/.vscode/settings.json
19+
!/.vscode/extensions.json

Diff for: packages/eslint-plugin-typescript/.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ node_js:
55
- "8"
66
- "10"
77
- "11"
8+
install: yarn
9+
script:
10+
- yarn lint
11+
- yarn format-check
12+
- yarn docs:check
13+
- yarn test
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"recommendations": [
3+
"esbenp.prettier-vscode",
4+
"dbaeumer.vscode-eslint",
5+
"editorconfig.editorconfig"
6+
],
7+
"unwantedRecommendations": [
8+
"hookyqr.beautify",
9+
"dbaeumer.jshint"
10+
]
11+
}

Diff for: packages/eslint-plugin-typescript/.vscode/settings.json

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
// Format a file on save. A formatter must be available, the file must not be auto-saved, and editor must not be shutting down.
3-
"editor.formatOnSave": true,
4-
52
// An array of languages where Emmet abbreviations should not be expanded.
63
"emmet.excludeLanguages": [
74
"markdown",

Diff for: packages/eslint-plugin-typescript/CONTRIBUTING.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributing
2+
3+
## Commenting and Discussing
4+
5+
***Don't be a douche.***
6+
Consider the following when commenting:
7+
8+
- Everyone is a human (except for the bots).
9+
- Everyone is freely providing their time for this project.
10+
- Everyone wants to build the best tool.
11+
12+
## PR Requirements
13+
14+
For a PR to be merged, you must pass the following checks:
15+
16+
- there must be no lint errors - `yarn lint`
17+
- the code must be formatted - `yarn format`
18+
- your documentation must be up to date - `yarn docs-check`
19+
- all tests must pass - `yarn test`
20+
21+
There is a commit hook which will help you follow this.
22+
Travis will also automatically run these checks when you submit your PR (and will block us merging until you fix it).
23+
24+
## Adding/Changing a rule
25+
26+
When adding or changing a rule, you must:
27+
28+
- Ensure your feature / bug has an issue behind it.
29+
- This just makes it easier for people to find information in future, because PRs aren't included in the default issue search.
30+
- Ensure your changes are covered by tests.
31+
- There's no hard and fast rule for how much testing is required, but try to cover as many bases as you can.
32+
- Ensure your changes are documented in the `docs` folder. We're working to standardise how we document rules, but your docs should:
33+
- describe what the rule does, and why you might enable it.
34+
- (if any) outline the settings; how to configure them and what each one does
35+
- have clear examples of valid and invalid code when using the rule. Bonus points for extra cases showing what each setting does.
36+
37+
When adding a rule, you must also add a link to the rule in the README.md.
38+
39+
## Submitting Issues
40+
41+
- If your issue relates to a rule, start your title with the rule name:
42+
- `[no-unused-vars] False positive when fooing the bar`
43+
- Search for the issue before you ask; we try hard to ensure it's easy to find existing issues.
44+
- Follow the template.
45+
- We've built it to reduce the chance of us going back to ask you for things.
46+
- Don't be lazy and skip parts of it; we'll just ask you for that information anyway, so it'll only delay the process.

Diff for: packages/eslint-plugin-typescript/package.json

+52-55
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,54 @@
11
{
2-
"name": "eslint-plugin-typescript",
3-
"version": "0.14.0",
4-
"description": "TypeScript plugin for ESLint",
5-
"keywords": [
6-
"eslint",
7-
"eslintplugin",
8-
"eslint-plugin"
9-
],
10-
"repository": "nzakas/eslint-plugin-typescript",
11-
"author": "Nicholas C. Zakas",
12-
"main": "lib/index.js",
13-
"scripts": {
14-
"lint": "eslint lib/ tests/",
15-
"lint:fix": "eslint lib/ tests/ --fix",
16-
"docs": "eslint-docs",
17-
"docs:check": "eslint-docs check",
18-
"format-no-write": "prettier-eslint lib/**/*.js tests/**/*.js --eslint-config-path=.eslintrc --eslint-ignore --prettier-ignore --eslint-path=node_modules/eslint --config=.prettierrc",
19-
"format": "yarn format-no-write --write",
20-
"format-check": "yarn format-no-write --list-different",
21-
"mocha": "mocha tests --recursive --reporter=dot",
22-
"pretest": "npm run lint",
23-
"test": "mocha tests --recursive --reporter=dot",
24-
"posttest": "npm run docs:check",
25-
"precommit": "npm test && lint-staged"
26-
},
27-
"dependencies": {
28-
"requireindex": "~1.2.0",
29-
"typescript-eslint-parser": "^17.0.1"
30-
},
31-
"devDependencies": {
32-
"eslint": "^5.9.0",
33-
"eslint-config-eslint": "^5.0.1",
34-
"eslint-config-prettier": "^3.3.0",
35-
"eslint-docs": "^0.1.1",
36-
"eslint-plugin-node": "^6.0.1",
37-
"eslint-plugin-prettier": "^3.0.0",
38-
"husky": "^1.2.0",
39-
"lint-staged": "^8.1.0",
40-
"mocha": "^5.2.0",
41-
"prettier-eslint-cli": "^4.7.1",
42-
"typescript": "~2.9"
43-
},
44-
"peerDependencies": {
45-
"eslint": ">=4.13.1 < 6"
46-
},
47-
"lint-staged": {
48-
"*.js": [
49-
"yarn format",
50-
"git add"
51-
]
52-
},
53-
"engines": {
54-
"node": ">=6"
55-
},
56-
"license": "MIT"
2+
"name": "eslint-plugin-typescript",
3+
"version": "0.14.0",
4+
"description": "TypeScript plugin for ESLint",
5+
"keywords": [
6+
"eslint",
7+
"eslintplugin",
8+
"eslint-plugin"
9+
],
10+
"repository": "nzakas/eslint-plugin-typescript",
11+
"author": "Nicholas C. Zakas",
12+
"main": "lib/index.js",
13+
"scripts": {
14+
"lint": "eslint lib/ tests/",
15+
"lint:fix": "eslint lib/ tests/ --fix",
16+
"docs": "eslint-docs",
17+
"docs:check": "eslint-docs check",
18+
"format-no-write": "prettier-eslint lib/**/*.js tests/**/*.js --eslint-config-path=.eslintrc --eslint-ignore --prettier-ignore --eslint-path=node_modules/eslint --config=.prettierrc",
19+
"format": "yarn format-no-write --write",
20+
"format-check": "yarn format-no-write --list-different",
21+
"test": "mocha tests --recursive --reporter=dot",
22+
"precommit": "yarn lint && yarn test && yarn docs:check && lint-staged"
23+
},
24+
"dependencies": {
25+
"requireindex": "~1.2.0",
26+
"typescript-eslint-parser": "^17.0.1"
27+
},
28+
"devDependencies": {
29+
"eslint": "^5.9.0",
30+
"eslint-config-eslint": "^5.0.1",
31+
"eslint-config-prettier": "^3.3.0",
32+
"eslint-docs": "^0.1.1",
33+
"eslint-plugin-node": "^6.0.1",
34+
"eslint-plugin-prettier": "^3.0.0",
35+
"husky": "^1.2.0",
36+
"lint-staged": "^8.1.0",
37+
"mocha": "^5.2.0",
38+
"prettier-eslint-cli": "^4.7.1",
39+
"typescript": "~2.9"
40+
},
41+
"peerDependencies": {
42+
"eslint": ">=4.13.1 < 6"
43+
},
44+
"lint-staged": {
45+
"*.js": [
46+
"yarn format",
47+
"git add"
48+
]
49+
},
50+
"engines": {
51+
"node": ">=6"
52+
},
53+
"license": "MIT"
5754
}

0 commit comments

Comments
 (0)