Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
feat(rules): enforce consistent usage of type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
agustinusnathaniel committed Jan 27, 2022
1 parent f3f04d7 commit 5086323
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ ESLint rules I use throughout my personal projects with bundled dependencies.
## 🔧 Installation

```bash
npm i --save-dev eslint@^7 eslint-config-sznm
npm i --save-dev eslint eslint-config-sznm

# or (if using yarn)

yarn add -D eslint@^7 eslint-config-sznm
yarn add -D eslint eslint-config-sznm
```

## :computer: Usage
Expand All @@ -26,6 +26,7 @@ add the extends to your project's eslintrc config
make sure `eslint-config-next` is installed (as `devDependencies`)

```js
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ['sznm/react', 'plugin:@next/next/recommended'],
};
Expand All @@ -34,6 +35,7 @@ module.exports = {
optional:

```js
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: [
'sznm/react',
Expand All @@ -46,6 +48,7 @@ module.exports = {
### ⚛️ React Projects

```js
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ['sznm/react'],
};
Expand All @@ -56,6 +59,7 @@ module.exports = {
> ❗⚠️ [WIP] still tinkering around here, I made this config with support for Next.js and React + TypeScript as first priority in mind.
```js
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ['sznm'],
};
Expand Down
4 changes: 4 additions & 0 deletions rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ module.exports = {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports' },
],
complexity: 'warn',
'no-console': 'error',
},
Expand Down

0 comments on commit 5086323

Please sign in to comment.