@snailicide/build-config
v1.3.0
Published
Snailicide Shared Build Configuration
Downloads
131
Maintainers
Readme
@snailicide/build-config 🐌
Snailicide Build Config Package
Provides repository with base configurations that can be extended in new packages.
NPM Homepage: @snailicide/build-config
Configuration Files
- Typescript: tsconfig-base.json
- ESLint Base: .eslintrc.ts
- Prettier: prettier.config.js
Installation
#pnpm
pnpm add @snailicide/build-config -D
#yarn
yarn add @snailicide/build-config -D
#npm
npm install @snailicide/build-config --development
Examples
Typescript
/* tsconfig.json */
{
extends: '@snailicide/build-config/tsconfig-base',
compilerOptions: {
outDir: './../types',
rootDir: '.',
declarationDir: './../types',
},
exclude: ['**/*.test.ts'],
include: ['**/*.ts', '**/*.cts', '**/*.mts'],
}
Eslint
/* eslint.config.js */
import { EsLint } from '@snailicide/build-config'
const FLAT_CONFIG = await EsLint.flatConfig()
export default [
...FLAT_CONFIG,
{
ignores: ['packages/**/docs/**/*'],
},
]
Prettier
/* include in package.json */
{
prettier: '@snailicide/build-config/prettier',
}
OR
/* prettier.config.cjs */
/* extend the base config */
const { Prettier, merge } = require('@snailicide/build-config')
const options = {
plugins: ['@shopify/prettier-plugin-liquid'],
overrides: [
{
files: '*.liquid',
options: {
tabWidth: 2,
},
},
],
}
module.exports = merge(Prettier.config, options)
Helpful Links
- Linting
Note: to transpile to (var and no arrow functions use target = ES5
TODO:
[ ] Implement Linting with Type Information [ ] naming conventions for exported functions [ ] enforce explicit return types