@ibg/config
is a collection of ESLint, Vite and Typescript configurations.
tsconfig.json
{
"extends": "@ibg/config/react-library.tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"declarationDir": "./dist/types",
},
"include": ["src"]
}
.eslintrc.js
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
root: true,
extends: [require.resolve('@ibg/config/eslint/react-internal'), 'plugin:storybook/recommended']
};
vitest.config.js
const { defineConfig, mergeConfig } = require('vitest/config');
const { nodeConfig } = require('@ibg/config/vite/node.config');
module.exports = mergeConfig(nodeConfig, defineConfig({}));
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
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.
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.