Skip to content

tsconfig.json and ESLint/Prettier configs for DAOT projects

License

Notifications You must be signed in to change notification settings

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.jsonc):

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.jsonc in the project root:

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

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.