@ibg/config
v0.0.14
Published
Collection of ESLint, Vite and Typescript configurations
Downloads
13
Readme
@ibg/config
is a collection of ESLint, Vite and Typescript configurations.
📖 Usage
Typescript
tsconfig.json
{
"extends": "@ibg/config/react-library.tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"declarationDir": "./dist/types",
},
"include": ["src"]
}
ESLint
.eslintrc.js
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
root: true,
extends: [require.resolve('@ibg/config/eslint/react-internal'), 'plugin:storybook/recommended']
};
Vitest
vitest.config.js
const { defineConfig, mergeConfig } = require('vitest/config');
const { nodeConfig } = require('@ibg/config/vite/node.config');
module.exports = mergeConfig(nodeConfig, defineConfig({}));
🙏 Contribution
Debugging ESLint Configuration
If you are encountering issues or unexpected behavior with ESLint, you can use the following command to output the final configuration.
npx eslint --print-config ./some/file/to/test/on.ts
🔴 Issues
TypeScript Configurations Location
TypeScript configurations are placed at the root to allow easy referencing from other packages in the monorepo using the extends
field in tsconfig.json
, like so:
{
"extends": "@ibg/config/base.json"
}
Node: Extending nested configuration didn't work.
🌟 Credits
This configuration is based on the turbo-basic
starter template and will be kept in sync with it as the Vercel team knows better than me what configurations settings are best for NextJs apps and co. Also tsconfig/bases
was a source of inspiration.