@kristijorgji/eslint-config-react-typescript 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +38 -0
- package/index.js +60 -0
- package/package.json +24 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Kristi Jorgji
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @kristijorgji/eslint-config-react-typescript
|
|
2
|
+
|
|
3
|
+
Eslint and prettier rules for ReactJS Typescript projects.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
### Install deps
|
|
8
|
+
Install the correct versions of each package, which are listed by the command:
|
|
9
|
+
```shell
|
|
10
|
+
yarn add --dev @kristijorgji/eslint-config-react-typescript@latest
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
If you are migrating old service to new plugin first please make sure to first remove old dependencies that are duplicates like example `yarn remove eslint prettier @typescript-eslint/eslint-plugin etc`
|
|
14
|
+
|
|
15
|
+
### Config
|
|
16
|
+
Add the following to your `.eslintrc.js`:
|
|
17
|
+
```js
|
|
18
|
+
module.exports = {
|
|
19
|
+
extends: ['@kristijorgji/eslint-config-react-typescript'],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Develop
|
|
25
|
+
More info on how to develop your custom eslint config can be found here: https://eslint.org/docs/developer-guide/shareable-configs
|
|
26
|
+
|
|
27
|
+
To develop locally you can install with `yarn add --dev pathtolocalfile` example
|
|
28
|
+
`yarn add --dev /Users/kristi.jorgji/Desktop/fl-lite/eslint-config-react-typescript`
|
|
29
|
+
|
|
30
|
+
You need to run the above command after every plugin change.
|
|
31
|
+
|
|
32
|
+
## How to publish a new version
|
|
33
|
+
|
|
34
|
+
To publish a new package version you have to create a release tag in this repository.
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
[MIT](LICENSE)
|
package/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: [
|
|
3
|
+
'react-app',
|
|
4
|
+
'eslint:recommended',
|
|
5
|
+
'plugin:@typescript-eslint/recommended',
|
|
6
|
+
'plugin:import/errors',
|
|
7
|
+
'plugin:import/warnings',
|
|
8
|
+
'plugin:import/typescript',
|
|
9
|
+
'plugin:prettier/recommended',
|
|
10
|
+
],
|
|
11
|
+
rules: {
|
|
12
|
+
'prettier/prettier': [
|
|
13
|
+
'error',
|
|
14
|
+
{
|
|
15
|
+
semi: true,
|
|
16
|
+
trailingComma: 'es5',
|
|
17
|
+
singleQuote: true,
|
|
18
|
+
printWidth: 120,
|
|
19
|
+
tabWidth: 4,
|
|
20
|
+
useTabs: false,
|
|
21
|
+
bracketSpacing: true,
|
|
22
|
+
arrowParens: 'avoid',
|
|
23
|
+
endOfLine: "lf"
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
'import/no-anonymous-default-export': 'off',
|
|
27
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
28
|
+
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
29
|
+
'import/order': [
|
|
30
|
+
'error',
|
|
31
|
+
{
|
|
32
|
+
groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],
|
|
33
|
+
pathGroups: [
|
|
34
|
+
{
|
|
35
|
+
pattern: 'react',
|
|
36
|
+
group: 'external',
|
|
37
|
+
position: 'before',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
pattern: '@/**',
|
|
41
|
+
group: 'external',
|
|
42
|
+
position: 'after',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
pathGroupsExcludedImportTypes: ['react'],
|
|
46
|
+
'newlines-between': 'always',
|
|
47
|
+
alphabetize: {
|
|
48
|
+
order: 'asc',
|
|
49
|
+
caseInsensitive: true,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
'sort-imports': [
|
|
54
|
+
'error',
|
|
55
|
+
{
|
|
56
|
+
ignoreDeclarationSort: true,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kristijorgji/eslint-config-react-typescript",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "eslint config for react typescript based projects",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"eslint": "^8.31.0",
|
|
11
|
+
"eslint-config-prettier": "^8.6.0",
|
|
12
|
+
"eslint-config-react-app": "^7.0.1",
|
|
13
|
+
"eslint-plugin-import": "^2.26.0",
|
|
14
|
+
"eslint-plugin-prettier": "^4.2.1"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"react",
|
|
18
|
+
"typescript",
|
|
19
|
+
"eslint",
|
|
20
|
+
"prettier"
|
|
21
|
+
],
|
|
22
|
+
"author": "kristijorgji",
|
|
23
|
+
"license": "MIT"
|
|
24
|
+
}
|