0.1.5 • Published 3 years ago
eslint-plugin-kriszu v0.1.5
eslint-plugin-kriszu
ESLint rules for Kriszu.
- eslint-plugin-kriszu
- Rules
- import-dedupe
- prefer-inline-type-import
- Rules
Rules
import-dedupe
Fix duplication in imports
The following patterns are considered problems:
import { a, b, a, a, c, a } from 'footer'
// Message: undefinedThe following patterns are not considered problems:
import { a, b, c, } from 'footer'prefer-inline-type-import
TypeScript 4.5 introduced type modifiers that allow to inline type imports as opposed to having dedicated import type. This allows to remove duplicate type imports. This rule enforces use of import type modifiers.
The following patterns are considered problems:
import type { foo } from 'bar'
// Message: undefined
import type { foo, baz } from 'bar'
// Message: undefinedThe following patterns are not considered problems:
import {type foo} from 'bar'
import type Foo from 'bar'
import type * as Foo from 'bar'Install
npm add -D eslint eslint-plugin-kriszuConfig .eslintrc
{
"plugins": ["kriszu"]
}You don't need
.eslintignorenormally as it has been provided by the preset.
Add script for package.json
For example:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}This project is based on @antfu/eslint-config
License
MIT License © 2022-PRESENT Krizsu