@avenue3-dev/eslint-config
v1.1.4
Published
A collection of ESLint configurations for Avenue3 projects.
Downloads
186
Readme
A collection of ESLint configurations for Avenue3 projects. This uses the Airbnb configuration as a base and adds some additional rules and configurations.
This configuration is intended to be used with TypeScript projects.
Installation
npm install @avenue3-dev/eslint-config \
@typescript-eslint/eslint-plugin@^7.2.0 \
@typescript-eslint/parser@^7.2.0 \
--save-dev
Usage
Node
// .eslintrc.cjs
module.exports = {
root: true,
env: { browser: true, es2020: true },
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: {
project: './tsconfig.json',
},
extends: ['@avenue3-dev/eslint-config'],
};
React
// .eslintrc.cjs
module.exports = {
root: true,
env: { browser: true, es2020: true },
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: {
project: './tsconfig.json',
},
extends: ['@avenue3-dev/eslint-config/react'],
};
Prettier
We use Prettier as our code formatter and have a default configuration that we use across all projects. You can use this configuration by creating a prettier.config.cjs
file in the root of your project.
//prettier.config.cjs
/** @type {import("prettier").Config} */
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
semi: true,
singleQuote: true,
printWidth: 80,
endOfLine: 'lf',
};