@axa-ch/easy-config
v6.1.0
Published
Modern and strict configuration files to build consistently web applications.
Readme
easy-config
Modern and strict configuration files to build consistently web applications.
Table of content
Getting started
Installation
Start by installing Biome and @axa-ch/easy-config.
npm i -D --save-exact @biomejs/biome @axa-ch/easy-configConfiguration
Create a biome.json file at the root of your project
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["./node_modules/@axa-ch/easy-config/biome/base.json"]
}You can configure this to your liking. Follow the Biome configuration guide.
The shared configuration enables Biome's linter and formatter for JavaScript, CSS, and SCSS.
It also enables Biome's useSortedProperties assist action, so
CSS properties are kept in a consistent order.
Tailwind CSS is supported out of the box: Tailwind directives (@theme, @apply, @utility, ...)
are parsed in CSS files, duplicate classes are removed, and class strings are sorted and simplified via Biome's Tailwind
lint rules. Non-Tailwind classes are left untouched.
Run checks and format files with Biome:
npx biome check .
npx biome format --write .IDE Integration
Biome provides plugins for the most common IDEs:
IntelliJ
Use the Biome IDE integration for linting and formatting. Configure your editor to run Biome's formatter on save if you want files to be formatted automatically.
Typescript setup
Start by installing typescript:
npm i -D --save-exact typescriptThen, create a tsconfig.json file and extend @axa-ch/easy-config:
{
"extends": ["@axa-ch/easy-config/ts-config/base"]
}Stylelint setup
Start by installing stylelint and the rules used by easy-config:
npm i -D --save-exact stylelint stylelint-config-standardExtend easy-config in the .stylelintrc.js file:
import { stylelint } from '@axa-ch/easy-config';
/** @type {import('stylelint').Config} */
export default {
extends: [stylelint.base],
};SCSS Setup
To use Stylelint with SASS, start by installing the SCSS default config for stylelint:
npm i -D --save-exact stylelint-config-standard-scssExtend your stylelint configuration like shown below:
import { stylelint } from '@axa-ch/easy-config';
/** @type {import('stylelint').Config} */
export default {
extends: [stylelint.base, stylelint.scss],
};