Skip to content

Commit

Permalink
패키지 업데이트 및 타입스크립트룰 airbnb로 바꾸기 (#26)
Browse files Browse the repository at this point in the history
* feature: fix lint

* feature typescript rules

* remove tsconfig.json

* use eslint-config-typescript

* remove .ds-store from gitignore
  • Loading branch information
notoriousmango authored Dec 30, 2020
1 parent cfe7ca2 commit 0792802
Show file tree
Hide file tree
Showing 6 changed files with 417 additions and 246 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
node_modules/
node_modules/
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ Install `@ridi/eslint-config` package:
```
npm info "@ridi/eslint-config" peerDependencies
```
if using **npm 5+**, use this shortcut
```
npx install-peerdeps --dev @ridi/eslint-config
```
if using **yarn**, use this command
```
yarn add --peer --dev @ridi/eslint-config
```
2. Install via package manager:
```
npm install --save-dev eslint @ridi/eslint-config
npm install --save-dev @ridi/eslint-config
```
or
```
yarn --dev eslint @ridi/eslint-config
yarn --dev @ridi/eslint-config
```

## Usage
Expand All @@ -32,7 +40,7 @@ module.exports = {

### @ridi/eslint-config/typescript
> * @typescript-eslint/eslint-plugin
> * typescript
#### Typescript
```javascript
Expand Down Expand Up @@ -66,7 +74,7 @@ module.exports = {
module.exports = {
extends: [
'@ridi/eslint-config',
'@ridi/eslint-config/typescript'
'@ridi/eslint-config/typescript',
'@ridi/eslint-config/react'
]
}
Expand All @@ -86,7 +94,3 @@ works fine with local configuration file (e.g. .prettierrc)
],
}
```




4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
env: {
es2020: true,
es2021: true,
},
extends: ['eslint:recommended', 'airbnb-base'],
parserOptions: {
ecmaVersion: 11,
ecmaVersion: 12,
sourceType: 'module',
},
rules: {
Expand Down
31 changes: 17 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,28 @@
},
"homepage": "https://github.com/ridi/eslint-config#readme",
"dependencies": {
"@typescript-eslint/parser": "^4.1.0",
"@typescript-eslint/parser": "^4.11.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.9.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0"
"eslint": "^7.16.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^7.1.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/eslint-plugin": "^4.11.0",
"eslint-config-airbnb-typescript": "^12.0.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.2",
"prettier": "^2.1.1",
"react": "^16.13.1",
"typescript": "^4.0.2"
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.2.1",
"react": "^17.0.1",
"typescript": "^4.1.3"
},
"peerDependencies": {
"eslint": ">= 3"
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
"eslint-plugin-import": "^2.22.1"
}
}
7 changes: 3 additions & 4 deletions typescript.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
project: './tsconfig.json', // required for plugin:@typescript-eslint/recommended-requiring-type-checking
project: ['./tsconfig.json'], // Specify it only for TypeScript files
},
plugins: [
'@typescript-eslint',
],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'airbnb-typescript',
],
};
Loading

0 comments on commit 0792802

Please sign in to comment.