1.1.3 • Published 4 months ago

@jihyunlab/eslint-config v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@jihyunlab/eslint-config

Version Downloads Last commit License

JihyunLab ESLint config for TypeScript.

Setup

1) Setup regular JihyunLab ESLint config

npm i --save-dev @jihyunlab/eslint-config

or

yarn add --dev @jihyunlab/eslint-config eslint@^8.34.0 @typescript-eslint/eslint-plugin@^5.52.0 @typescript-eslint/parser@^5.52.0 eslint-config-prettier@^8.6.0

2) Configure ESLint

.eslintrc.json file structure

.
├── .eslintrc.json
└── ...

Within your .eslintrc.json file:

"extends": [
+ "@jihyunlab/eslint-config"
]
"parserOptions": [
+ "project": "./tsconfig.json"
]

Example .eslintrc.json file:

{
  "extends": [
    "@jihyunlab/eslint-config"
  ],
  "parserOptions": {
    "project": "./tsconfig.json"
  }
}

Additional settings

Additional settings file structure

.
├── .vscode                   # Visual Studio Code
│   └── extensions.json
├── .eslintignore             # Ignore file(ESLint)
└── ...

Additional configuration files can be found on the git page.

https://github.com/jihyunlab/eslint-config

1) Ignore file

Example .eslintignore file:

/node_modules
/build
/dist

2) Visual Studio Code

Within your .vscode/extensions.json file:

{
  "recommendations": [
+   "dbaeumer.vscode-eslint"
  ]
}

Troubleshooting

1) When a peer dependencies package is not installed

npm i --save-dev eslint@^8.34.0 @typescript-eslint/eslint-plugin@^5.52.0 @typescript-eslint/parser@^5.52.0 eslint-config-prettier@^8.6.0

2) Conflict between ESLint and Prettier configs

Delete Prettier related configs in ESLint.

Within your .eslintrc.json file:

"extends": [
  "@jihyunlab/eslint-config",
+ "prettier"
]

3) I get this error when running ESLint: "The file must be included in at least one of the projects provided"

Create a tsconfig.eslint.json file

.
├── tsconfig.eslint.json
└── ...

Example tsconfig.eslint.json file:

{
  "extends": "./tsconfig.json",
  "include": ["src/**/*.ts", "src/**/*.js", "test/**/*.ts"]
}

Change .eslintrc.json file:

"parserOptions": [
- "project": "./tsconfig.json"
+ "project": "./tsconfig.eslint.json"
]

Check out the link below for other detailed TypeScript ESLint errors.

https://typescript-eslint.io/linting/troubleshooting/

Credits

Authored and maintained by JihyunLab <info@jihyunlab.com>

License

Open source licensed as MIT.

1.1.3

4 months ago

1.1.2

4 months ago

1.1.1

6 months ago

1.1.0

9 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago