eslint-config-husds3
v0.1.2
Published
ESLint rules and configurations for projects of the third semester Software Development at Hogeschool Utrecht.
Maintainers
Readme
eslint-config-husds3
This package provides a set of ESLint rules and configurations for projects of the third semester of the Bachelor programme Software Development at the University of Applied Sciences Utrecht (Hogeschool Utrecht). It aims to enforce best practices and maintain code quality in your Lit applications.
Features
- Predefined ESLint rules tailored for Lit applications.
- Configurations designed to enforce best practices in web component development.
- Easy integration into your project.
Installation
To install the eslint-config-husds3 package, run the following command:
npm install eslint-config-husds3 --save-devPeer Dependencies
Ensure you have the following peer dependencies installed in your project:
eslint(version^7.0.0 || ^8.0.0)lit(if your project uses Lit)
You can install them using:
npm install eslint lit --save-devUsage
To use the eslint-config-husds3 configuration in your ESLint setup, you need to import it as a flat configuration in your ESLint configuration file (e.g., eslint.config.js).
Example Configuration
Here’s an example of how to use the configuration in an eslint.config.js file:
import husds3Config from 'eslint-config-husds3/config';
export default [
...husds3Config,
{
rules: {
// additional rules
},
},
];Notes
- Ensure your project uses ESLint version 8.21.0 or later to support flat configurations.
- You can extend or override the rules by adding your own configurations to the array.
Customization
You can customize the rules by adding your own rules in the ESLint configuration file. For example:
module.exports = {
extends: 'eslint-config-husds3',
rules: {
'no-console': 'warn',
'lit/no-invalid-html': 'error'
}
};Example Rules
Here are some of the rules included in this package:
lit/no-invalid-html: Ensures that HTML templates in Lit are valid.no-console: Warns against usingconsole.login production code.no-dom-manipulation-outside-render: Prevents direct DOM manipulation outside therendermethod in Lit components.
Note: This configuration is designed for projects that use Lit. Make sure you have
litinstalled as a dependency in your project.
License
This project is licensed under the ISC License.
