Skip to content

Commit 180e4cb

Browse files
committed
Initial commit
0 parents  commit 180e4cb

File tree

7 files changed

+1925
-0
lines changed

7 files changed

+1925
-0
lines changed

.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
],
10+
}

.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: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# eslint-config-gitduck
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.
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+
```
31+
32+
Here is an example `.eslintrc.js`:
33+
34+
```javascript
35+
module.exports = {
36+
extends: 'gitduck',
37+
parser: '@typescript-eslint/parser',
38+
parserOptions: {
39+
project: './tsconfig.json',
40+
},
41+
plugins: [
42+
'@typescript-eslint',
43+
],
44+
}
45+
```
46+
47+
*Note: The `eslint-config-` prefix in `extends` is omitted since it is automatically assumed by ESLint.*
48+
49+
You can override settings from the shareable config by adding them directly into this file.

index.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
module.exports = {
2+
extends: 'standard-with-typescript',
3+
rules: {
4+
// Take advantage of type inference
5+
'@typescript-eslint/explicit-function-return-type': 'off',
6+
// Temporarily disable this rule
7+
'@typescript-eslint/no-floating-promises': 'off',
8+
// Forbids `any` in _falsy_ expressions
9+
'@typescript-eslint/strict-boolean-expressions': [
10+
'error',
11+
{
12+
allowAny: false,
13+
allowNullableBoolean: true,
14+
allowNullableNumber: true,
15+
allowNullableObject: true,
16+
allowNullableString: true,
17+
allowNumber: true,
18+
allowString: true,
19+
},
20+
],
21+
'comma-dangle': [
22+
'error',
23+
'always-multiline',
24+
{
25+
caseSensitive: false,
26+
},
27+
],
28+
'max-len': [
29+
'error',
30+
{
31+
code: 120,
32+
ignoreComments: true,
33+
ignoreRegExpLiterals: true,
34+
ignoreStrings: true,
35+
ignoreTemplateLiterals: true,
36+
ignoreUrls: true,
37+
tabWidth: 4,
38+
},
39+
],
40+
'sort-keys': [
41+
'error',
42+
'asc',
43+
{
44+
caseSensitive: false,
45+
},
46+
],
47+
},
48+
}

0 commit comments

Comments
 (0)