📦 SETUP • ⚙️ CONFIGURATION • ️️️🛰️ FEATURES
This GitHub repository offers a powerful ESLint configuration to elevate your coding experience. Proactively identify and fix potential errors before they cause issues, preventing runtime failures and streamlining your development workflow. The configuration enforces consistent coding style and best practices, making your codebase easier to understand, modify, and collaborate on in the long run. It's built to be adaptable, allowing you to fine-tune the rules to your project's specific needs. Leverage a curated set of pre-configured ESLint rules, easily add or remove rules for further customization, and benefit from clear documentation that explains the reasoning behind each rule. ( Back to top ) |
( Back to top )
-
Eslint
- Eslint linter -
Astro
- Catch errors and write awesome Astro components! -
Html
- Keep your HTML files tidy and consistent. -
Import
- Make your imports easy to find and manage. -
Javascript
- Write clean and maintainable JavaScript code. -
Json
- Ensure your JSON data is well-structured. -
Node
- Follow recommended practices for Node.js environments. -
Perfectionist
- Go beyond the basics with stricter code quality checks. -
Regex
- Craft powerful and maintainable regular expressions. -
Solid
- Write robust Solid components with confidence. -
Stylistic
- Improve readability and maintainability with stylistic rules. -
Typescript
- Enforce type safety and keep your code clear. -
Unicorn
- Leverage advanced rules for an extra quality boost. -
Yaml
- Keep your YAML files clean and consistent.
( Back to top )
( Back to top )
Run this command to install eslint and the plugin.
bun i -D eslint eslint-config-elegant-coding
pnpm i -D eslint eslint-config-elegant-coding
yarn i -D eslint eslint-config-elegant-coding
npm i -D eslint eslint-config-elegant-coding
( Back to top )
To use this plugin put in your repositorie you need to create an eslint.config.js
file and add this lines of code.
import elegantCoding from 'eslint-config-elegant-coding';
export default elegantCoding();
( Back to top )
Extra settings that can be added.
import elegantCoding from 'eslint-config-elegant-coding';
export default elegantCoding({
// This line enables ESLint rules for YAML files.
yml: true,
// This line enables ESLint rules for HTML files.
html: true,
// This line enables ESLint rules for JSON files.
json: true,
// This line enables ESLint rules for Solid components.
solid: true,
// This line enables ESLint rules for Astro components.
astro: true,
// This line enables ESLint rules for tailwind classes.
tailwind: true,
// This line specifies a file to ignore from linting.
// In this case, 'postcss.config.cjs' will not be processed by ESLint.
ignore: [ 'postcss.config.cjs' ],
// This line enables ESLint rules for stylistic concerns in your code.
stylistic: true,
// This line enables ESLint rules for TypeScript files.
typescript: true,
});
To add or override plugins and options, you can pass a second attribute to the function with an array like a normal configuration of eslint:
export default elegantCoding({
stylistic: true,
typescript: true
}, [
{
rules:
{
'style/indent': 'off'
}
},
{
plugin: 'customPlugin',
rules:
{
// Extra rules...
}
}
]);
The list of the used plugins and the names are here:
New name | Original | Source |
---|---|---|
import |
import-x |
eslint-plugin-import-x |
unicorn |
unicorn |
eslint-plugin-unicorn |
perfectionist |
perfectionist |
eslint-plugin-perfectionist |
node |
n |
eslint-plugin-n |
regex |
regexp |
eslint-plugin-regexp |
style |
@stylistic |
@stylistic/eslint-plugin |
ts |
@typescript-eslint |
@typescript-eslint/eslint-plugin |
html |
@html-eslint |
@html-eslint/eslint-plugin |
json |
jsonc |
eslint-plugin-jsonc |
yml |
yml |
eslint-plugin-yml |
astro |
astro |
eslint-plugin-astro |
tailwind |
tailwindcss |
eslint-plugin-tailwindcss |
( Back to top )
Copyright © All rights reserved, developed by ElegantCoder and