1.0.6 • Published 5 months ago
@act-aks/eslint-config v1.0.6
@act-aks/eslint-config
A shared ESLint configuration package that provides a comprehensive set of rules for TypeScript projects. This configuration is designed to enforce consistent code style and catch potential errors early in development.
Features
TypeScript-First Configuration
- Strict type checking and validation
- Proper handling of TypeScript-specific patterns
- Smart type inference rules
- Consistent type imports/exports
- No unsafe type assertions
- Proper promise typing
- Exhaustive switch statements
Code Quality Rules
- Comprehensive error prevention
- Best practices enforcement
- Memory leak prevention
- Proper promise handling
- Consistent error handling
- No unused variables/imports
- Proper async/await usage
Style Enforcement
- Import/Export sorting and organization
- Sorted imports by groups
- No duplicate imports
- Proper module resolution
- Consistent path aliases
- Naming Conventions
- camelCase for variables and functions
- PascalCase for classes and types
- UPPER_CASE for constants
- File Organization
- Consistent file naming
- Proper test file naming (.spec.ts)
- Directory structure rules
Installation
yarn add -D @act-aks/eslint-config
Usage
Create an eslint.config.js
file in your project root:
import { configs } from '@act-aks/eslint-config'
export default [...configs.react, ...configs.reactNative, ...configs.recommended]
Rule Sets
Core Rules
no-unused-vars
: Prevents unused variable declarationsno-console
: Disallows console.log statementsno-alert
: Prevents alert/confirm/prompt usagecurly
: Enforces consistent brace styleeqeqeq
: Requires === and !==
TypeScript Rules
@typescript-eslint/no-explicit-any
: Prevents any type usage@typescript-eslint/explicit-function-return-type
: Optional return type declarations@typescript-eslint/no-unused-vars
: TypeScript-aware unused variable checks@typescript-eslint/no-non-null-assertion
: Prevents non-null assertions
Import Rules
- Sort imports by groups:
- Third-party modules
- Internal modules
- Relative imports
- Enforce newlines between import groups
- Prevent duplicate imports
- Sort import specifiers alphabetically
Promise Rules
promise/prefer-await-to-then
: Prefer async/await over .then()promise/prefer-await-to-callbacks
: Prefer async/await over callbacks- Proper error handling in async operations
File Naming Rules
- Test files must use .spec.ts extension
- Consistent casing across filenames
- Directory structure validation
Editor Integration
For the best development experience, ensure your editor has ESLint integration installed:
- VS Code: ESLint extension
- WebStorm: Built-in ESLint support
- Vim/Neovim: ALE or similar plugin
Contributing
- Clone the repository
- Install dependencies:
yarn install
- Build the package:
nx build eslint-config
- Run tests:
nx test eslint-config
License
1.0.6
5 months ago
1.0.5
6 months ago
1.0.4
6 months ago
1.0.3
6 months ago
1.0.2
7 months ago
1.0.1
7 months ago
1.0.0
7 months ago
0.3.1
7 months ago
0.3.0
7 months ago
0.2.1
7 months ago
0.2.0
7 months ago
0.1.6
7 months ago
0.1.5
7 months ago
0.1.4
7 months ago
0.1.3
7 months ago
0.1.2
7 months ago
0.1.1
7 months ago
0.1.0
7 months ago
0.0.4
7 months ago
0.0.3
7 months ago
0.0.1
7 months ago