Skip to content

Commit

Permalink
Update eslint-config-typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej-nemecek committed Mar 13, 2024
1 parent 7f7d328 commit f71474b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 38 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# GoodRequest JavaScript Style Guide

Choose ESLint config for your project:
### [@goodrequest/eslint-config-typescript-next](https://www.npmjs.com/package/@goodrequest/eslint-config-typescript-next) [![npm version](https://badge.fury.io/js/@goodrequest%2Feslint-config-typescript-next.svg)](https://badge.fury.io/js/@goodrequest%2Feslint-config-typescript-next)

ESLint config for TypeScript + Next.js projects

### [@goodrequest/eslint-config-typescript-react](https://www.npmjs.com/package/@goodrequest/eslint-config-typescript-react) [![npm version](https://badge.fury.io/js/@goodrequest%2Feslint-config-typescript-react.svg)](https://badge.fury.io/js/@goodrequest%2Feslint-config-typescript-react)

ESLint config for JavaScript + TypeScript projects
ESLint config for TypeScript + React.js projects

### [@goodrequest/eslint-config-javascript-react](https://www.npmjs.com/package/@goodrequest/eslint-config-javascript-react) [![npm version](https://badge.fury.io/js/@goodrequest%2Feslint-config-javascript-react.svg)](https://badge.fury.io/js/@goodrequest%2Feslint-config-javascript-react)

ESLint config for JavaScript + React projects
ESLint config for JavaScript + React.js projects

### [@goodrequest/eslint-config-typescript](https://www.npmjs.com/package/@goodrequest/eslint-config-typescript) [![npm version](https://badge.fury.io/js/@goodrequest%2Feslint-config-typescript.svg)](https://badge.fury.io/js/@goodrequest%2Feslint-config-typescript)

Expand Down
24 changes: 6 additions & 18 deletions eslint-config-typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,24 @@
ESLint config for TypeScript projects.

## Usage
1. If using **npm 7+** you can install this package and npm automatically installs all peer dependencies.
1. You can install package using this command:
```
npm install @goodrequest/eslint-config-typescript --save-dev
```

If you are using an **older npm** version, then the **next step** is to install all the peer dependencies listed with:
2. **Next step** is to install all the peer dependencies:
```
npm info "@goodrequest/eslint-config-typescript" peerDependencies
{
eslint: '^8.2.0',
'eslint-plugin-import': '^2.25.3',
'eslint-plugin-prettier': '^4.0.0',
'@typescript-eslint/eslint-plugin': '^5.4.0',
prettier: '^2.4.1'
}
```
Here is `npm install` command you can use:
```
npm install eslint@^8.2.0 eslint-plugin-import@^2.25.3 eslint-plugin-prettier@^4.0.0 @typescript-eslint/eslint-plugin@^5.4.0 prettier@^2.4.1 --save-dev
npm install eslint@^8.57.0 eslint-plugin-import@^2.29.1 eslint-plugin-prettier@^5.1.3 @typescript-eslint/eslint-plugin@^7.2.0 prettier@^3.2.5 --save-dev
```

2. Create `.eslintrc.json` file in your project root directory and add following lines:
3. Create `.eslintrc.json` file in your project root directory and add following lines:
```
{
"extends": ["@goodrequest/eslint-config-typescript"]
}
```

3. Create `.prettierrc.json` file in your project root directory and add following lines:
4. Create `.prettierrc.json` file in your project root directory and add following lines:
```
{
"useTabs": true,
Expand All @@ -46,7 +34,7 @@ npm install eslint@^8.2.0 eslint-plugin-import@^2.25.3 eslint-plugin-prettier@^4
}
```

4. Create `.editorconfig` file in your project root directory and add following lines:
5. Create `.editorconfig` file in your project root directory and add following lines:
```
[*]
indent_style = tab
Expand Down
3 changes: 1 addition & 2 deletions eslint-config-typescript/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
env: {
node: true,
es2021: true,
es2024: true,
},
plugins: ["@typescript-eslint", "prettier"],
extends: [
Expand All @@ -12,7 +12,6 @@ module.exports = {
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2022,
project: "./tsconfig.json",
},
rules: {
Expand Down
32 changes: 16 additions & 16 deletions eslint-config-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@goodrequest/eslint-config-typescript",
"version": "1.2.1",
"version": "1.3.0",
"description": "GoodRequest ESLint config for TypeScript projects",
"main": "index.js",
"keywords": [
"eslint",
"eslintconfig"
],
"author": "Andrej Nemecek",
"author": "GoodRequest",
"repository": {
"type": "git",
"url": "https://github.com/GoodRequest/eslint.git"
Expand All @@ -19,23 +19,23 @@
"license": "ISC",
"dependencies": {
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"@typescript-eslint/parser": "^5.4.0"
"eslint-config-prettier": "^9.1.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"@typescript-eslint/parser": "^7.2.0"
},
"devDependencies": {
"eslint": "^8.2.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-prettier": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"prettier": "^2.4.1",
"typescript": "^4.5.2"
"eslint": "^8.57.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"prettier": "^3.2.5",
"typescript": "^5.4.2"
},
"peerDependencies": {
"eslint": "^8.2.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-prettier": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"prettier": "^2.4.1"
"eslint": "^8.57.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"prettier": "^3.2.5"
}
}

0 comments on commit f71474b

Please sign in to comment.