Skip to content

daotl/web-configs

Repository files navigation

Config for web development tools for DAOT projects

This monorepo includes packages for:

  • tsconfig.json for TypeScript
  • biome.json for Biome
  • ESLint configs
  • dprint.json for dprint
  • Prettier config

Installation

tsconfig.json:

npm install -D @daotl/tsconfig

Biome config (biome.json):

npm install -D @daotl/biome-config

ESLint config (including dprint config):

npm install -D @daotl/eslint-config

dprint config (using without ESLint):

npm instasll -D @daotl/dprint-config

Prettier config (deprecated):

npm install -D @daotl/prettier-config

Usage

Using tsconfig.json

Extend the provided config in tsconfig.json:

{
  "extends": "@daotl/tsconfig/xxx.json",
  "compilerOptions": {
    "outDir": "dist"
  }
}

Replace xxx with one of node, browser or vue.

Using Biome config

Create biome.json in the project root:

{
  "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
  "extends": ["./node_modules/@daotl/biome-config/dist/biome.json"],
  // add your overrides here...
}

If you want to extend the default config (e.x., for adding files.ignore field), create a biome.ext.json in the project root like this before running the above step:

{
  "files": {
    "ignore": ["dist"]
  }
}

Using ESLint config

eslint.config.js:

import config from '@daotl/eslint-config'

export default config({
    // typescript: true, // Will auto detect
    // browser: true,
    // vue: true, // Will auto detect
  },
  {
    // Extend with your config ...
  },
  {
    // More extensions ...
  }
)

See @antfu/eslint-config for more options.

Using dprint config without ESLint

Add the extends field in your dprint.json config file:

{
  "extends": ["./node_modules/@daotl/dprint-config/dist/dprint.json"]
}

Using Prettier config (deprecated)

Reference @daotl/web-config/prettier in your package.json:

{
  "name": "my-cool-library",
  "version": "9000.0.1",
  "prettier": "@daotl/prettier-config"
}

Or you can extend the provided Prettier config in .prettierrc.js:

module.exports = {
  ...require("@daotl/prettier-configs"),
  // your custom options
}

References

License

MIT © DAOT Labs.