@zeitonline/eslint-config
v3.0.0
Published
Common eslint config for DIE ZEIT
Readme
@zeitonline/eslint-config
This package provides a shared Eslint configuration for projects at DIE ZEIT.
This is an ESM-only package.
Installation & Usage
1. Install the package
For example using npm:
npm install --save-dev @zeitonline/eslint-config2. Create or update the eslint.config.js file
Add an eslint.config.js (or .ts) file to the root of your project and extend the shared configuration. You can choose to use the base configuration or the Svelte-specific configuration:
Base Config
Intended for all JS or TS projects.
For JavaScript Projects (Default)
import zonEslintConfig from '@zeitonline/eslint-config';
module.exports = [
...zonEslintConfig, // or zonEslintConfig.js
{
// Add your project-specific overrides here
},
];For TypeScript Projects
import zonEslintConfig from '@zeitonline/eslint-config';
module.exports = [
...zonEslintConfig.ts,
{
// Add your project-specific overrides here
},
];Svelte Config
Intended for Svelte or SvelteKit projects. This config extends the base config and adds Svelte-specific plugins and rules.
For JavaScript Svelte Projects (Default)
import zonEslintConfigSvelte from '@zeitonline/eslint-config/svelte';
module.exports = [
...zonEslintConfigSvelte, // or zonEslintConfigSvelte.js
{
// Add your project-specific overrides here
},
];For TypeScript Svelte Projects
import zonEslintConfigSvelte from '@zeitonline/eslint-config/svelte';
module.exports = [
...zonEslintConfigSvelte.ts,
{
// Add your project-specific overrides here
},
];3. (Optional) Add a lint script to your package.json
To conveniently lint your files you may add a new script to your package.json:
{
"scripts": {
"lint": "eslint ."
}
}