Skip to content

Commit 951f0e7

Browse files
committed
Initial commit
0 parents  commit 951f0e7

File tree

7 files changed

+2133
-0
lines changed

7 files changed

+2133
-0
lines changed

.eslintrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
extends: './index.js',
3+
parser: '@typescript-eslint/parser',
4+
parserOptions: {
5+
project: './tsconfig.json',
6+
},
7+
plugins: [
8+
'@typescript-eslint',
9+
'react',
10+
],
11+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.vscode/
2+
node_modules/

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# eslint-config-gitduck-react
2+
3+
#### An [ESLint shareable config](https://eslint.org/docs/developer-guide/shareable-configs) for TypeScript that is based on [eslint-config-standard-with-typescript](https://github.com/standard/eslint-config-standard-with-typescript) and has GidDuck specific rules for React apps.
4+
5+
[![JavaScript Style Guide - Standard Style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](http://standardjs.com)
6+
7+
## Usage
8+
9+
Shareable configs are designed to work with the `extends` feature of `.eslintrc` files.
10+
You can learn more about
11+
[Shareable Configs](http://eslint.org/docs/developer-guide/shareable-configs) on the
12+
official ESLint website.
13+
14+
Run the following command:
15+
16+
```shell
17+
npm install --save-dev \
18+
eslint@7 \
19+
eslint-config-standard@14 \
20+
eslint-plugin-standard@4 \
21+
eslint-plugin-promise@4 \
22+
eslint-plugin-import@2 \
23+
eslint-plugin-node@11 \
24+
eslint-plugin-react@7 \
25+
typescript@3 \
26+
@typescript-eslint/eslint-plugin@3 \
27+
@typescript-eslint/parser@3 \
28+
eslint-config-standard-with-typescript@18 \
29+
github:gitduckhq/eslint-config-gitduck \
30+
github:gitduckhq/eslint-config-gitduck-react
31+
```
32+
33+
Here is an example `.eslintrc.js`:
34+
35+
```javascript
36+
module.exports = {
37+
extends: 'gitduck-react',
38+
parser: '@typescript-eslint/parser',
39+
parserOptions: {
40+
project: './tsconfig.json',
41+
},
42+
plugins: [
43+
'@typescript-eslint',
44+
'react',
45+
],
46+
}
47+
```
48+
49+
*Note: The `eslint-config-` prefix in `extends` is omitted since it is automatically assumed by ESLint.*
50+
51+
You can override settings from the shareable config by adding them directly into this file.

index.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
extends: [
3+
'gitduck',
4+
'plugin:react/recommended',
5+
],
6+
rules: {
7+
'react/jsx-indent': [
8+
'error',
9+
2,
10+
],
11+
'react/jsx-max-props-per-line': [
12+
'error',
13+
{
14+
maximum: 1,
15+
when: 'multiline',
16+
},
17+
],
18+
'react/jsx-sort-props': [
19+
'error',
20+
{
21+
ignoreCase: true,
22+
},
23+
],
24+
},
25+
settings: {
26+
react: {
27+
pragma: 'React',
28+
version: 'detect',
29+
},
30+
},
31+
}

0 commit comments

Comments
 (0)