Various shared ESLint configurations for Zakodium projects.
npm install -D eslint-config-zakodium eslint
Create a file named eslint.config.mjs
at the root of the project and extend the
config that you want to use. Example:
import { defineConfig } from 'eslint/config';
import ts from 'eslint-config-zakodium/ts';
import adonisV5 from 'eslint-config-zakodium/adonis-v5';
export default defineConfig(ts, adonisV5);
This package re-exports globals
for convenience:
import { defineConfig } from 'eslint/config';
import { globals } from 'eslint-config-zakodium';
export default defineConfig({
languageOptions: {
globals: {
...globals.node,
},
},
});
In a monorepo, you may want to apply different configs for different paths. The defineConfig
ESLint helper allows to do that with extends
:
import { defineConfig, globalIgnores } from 'eslint/config';
import ts from 'eslint-config-zakodium/ts';
import adonisV5 from 'eslint-config-zakodium/adonis-v5';
import react from 'eslint-config-zakodium/react';
export default defineConfig(
// Global ignore patterns.
globalIgnores(['**/build']),
// Apply TypeScript config on the whole project.
ts,
{
// Apply Adonis v5 config only to the api.
files: ['api/**'],
extends: [adonisV5],
},
{
// Apply React config only to the frontend.
files: ['front/**'],
extends: [react],
},
);
zakodium/js
: Same as cheminfo/base.zakodium/ts
: Same as cheminfo-typescript/base. Also includescheminfo/base
!zakodium/jsdoc
: Same as cheminfo/jsdoc.zakodium/unicorn
: Same as cheminfo/unicorn.zakodium/react
: Same as cheminfo-react/basezakodium/adonis-v5
: Adapts some rules for AdonisJS 5 projects. Should be combined withzakodium/ts
.