@elsikora/eslint-config
v3.1.4
Published
ESLint configuration vision of ElsiKora
Downloads
2,419
Readme
- Overview
- Features
- Repository Structure
- Modules
- Getting Started
- Project Roadmap
- Contributing
- License
- Acknowledgments
Overview
The ESLint-Config is a meticulously designed ESLint configuration repository that aims to enhance code quality and ensure consistency across JavaScript and TypeScript projects. Its core functionalities include custom ESLint rules, integration with popular plugins like Prettier and Unicorn, and specialized support for NestJS environments. By outlining standards for filename conventions and the use of modern JavaScript features, alongside automating the release process for streamlined updates, ESLint-Config offers a comprehensive solution for developers seeking to enforce coding best practices and style consistency in their projects.
Features
| | Feature | Description |
|-----|-------------------|---------------------------------------------------------------------------------------------------|
| ⚙️ | Architecture | ESLint-Config is designed for JS/TS projects, integrating Prettier and Unicorn plugins. |
| 🔩 | Code Quality | Focuses on consistency & best practices by leveraging eslint, prettier, and custom ESLint rules. |
| 📄 | Documentation | Has basic documentation within code files and package.json
, outlining usage and contributions. |
| 🔌 | Integrations | Integrates with GitHub Actions for CI/CD, and uses @changesets/cli
for release management. |
| 🧩 | Modularity | Configurations are modular, allowing easy extension and customization for JS/TS projects. |
| 🧪 | Testing | No specific testing tools mentioned, focus is on linting and code style consistency. |
| ⚡️ | Performance | Performance impact is minimal, primarily affects development through linting processes. |
| 🛡️ | Security | No specific security measures mentioned, as it's a development tool focusing on code quality. |
| 📦 | Dependencies | Depends on various eslint plugins and configurations, including eslint-plugin-prettier
. |
| 🚀 | Scalability | Scalable through the addition of custom rules and extensions for various JavaScript environments. |
---
## Repository Structure
```sh
└── ESLint-Config/
├── .github
│ └── workflows
├── CHANGELOG.md
├── README.md
├── index.enums.ts
├── nest.js
└── package.json
Modules
| File | Summary | |--------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | index.enums.ts | Defines and customizes ESLint rules for the ESLint-Config repository, focusing on ensuring code consistency while providing flexibility in filename conventions and the use of top-level await, by integrating popular ESLint configurations and plugins like Prettier and Unicorn. | | nest.js | Defines the ESLint configuration specifically for NestJS projects within the ESLint-Config repository. It selects an environment supporting ES2021 and Node.js, extending recommended settings from a custom plugin designed to enforce typing conventions and best practices tailored for NestJS development. |
Getting Started
System Requirements:
- ESLint:
>= 8.0.0
- Prettier:
>= 3.0.0
Installation
Install configuration from the repository using the command below:
$ npm install @elsikora/eslint-config --save-dev
Usage
To configure ESLint for your project, first install the necessary package(s) based on your project type. Then, create
a .eslintrc.json
file in your project root (if you haven't already) and add the corresponding configuration:
For JavaScript projects:
{ "extends": "@elsikora/eslint-config" }
For TypeScript projects:
{ "extends": "@elsikora/eslint-config/typescript" }
For NestJS projects:
{ "extends": "@elsikora/eslint-config/nest" }
For React projects:
{ "extends": "@elsikora/eslint-config/react" }
For JSON:
{ "extends": "@elsikora/eslint-config/json" }
For Yaml:
{ "extends": "@elsikora/eslint-config/yaml" }
Example Config
.eslintrc.json:
{
"env": {
"es6": true,
"jest": true,
"node": true
},
"extends": [
"@elsikora/eslint-config",
"@elsikora/eslint-config/typescript",
"@elsikora/eslint-config/nest",
"@elsikora/eslint-config/react",
"@elsikora/eslint-config/json",
"@elsikora/eslint-config/yml"
],
"ignorePatterns": [
".eslintrc.json"
],
"overrides": [
{
"files": [
"*.ts"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "tsconfig.json",
"tsconfigRootDir": "./"
}
}
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [
".ts",
".tsx"
]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": "./tsconfig.json"
}
}
},
"root": true
}
Project Roadmap
- [X]
► NestJS Configuration
- [X]
► React Configuration
- [ ]
► Next.js Configuration
Contributing
Contributions are welcome! Here are several ways you can contribute:
- Report Issues: Submit bugs found or log feature
requests for the
ESLint-Config
project. - Submit Pull Requests: Review open PRs, and submit your own PRs.
- Join the Discussions: Share your insights, provide feedback, or ask questions.
- Fork the Repository: Start by forking the project repository to your GitHub account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/ElsiKora/ESLint-Config.git
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to GitHub: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
License
This project is protected under the MIT License. For more details, refer to the LICENSE file.
Acknowledgments
- List any resources, contributors, inspiration, etc. here.