Code Monkey home page Code Monkey logo

block-dev's Introduction

block-dev

@block-dev/create-config

๐Ÿ”จ Utilities to create a well linted project

Featrues

  • eslint: standard/airbnb
  • stylelint: standard/recommended
  • prettier
  • commitlint
  • husky
  • lint-staged
  • typescript
  • vue2/vue3: eslint-vue
  • vite

Options

interface {
  name: string // name in package.json
  version?: string // version in package.json
  description?: string // description in package.json

  main?: boolean // if is main project in monorepo

  /* husky & commitlint */
  husky?: boolean // if use husky or not
  lint_staged?: boolean // if use lint-staged or not
  commitlint?: boolean // if use commitlint or not

  /* typescript */
  ts?: boolean // if use typescript or not
  ts_esm?: boolean // if add tsconfig.es.json or not

  /* eslint */
  standard?: boolean // if use eslint-config-standard or not
  airbnb?: boolean // if use eslint-config-airbnb or not

  /* stylelint */
  scss?: boolean // if use stylelint-scss plugin or not
  style_standard?: boolean // if use stylelint-config-standard or not
  style_recommended?: boolean // if use stylelint-config-recommended or not
  rational_order?: boolean // if use stylelint-config-rational-order or not

  /* eslint-vue */
  vue2_essential?: boolean // if use eslint-plugin-vue or not
  vue3_essential?: boolean
  vue2_strongly_recommended?: boolean
  vue3_strongly_recommended?: boolean
  vue2_recommended?: boolean
  vue3_recommended?: boolean

  /* vite */
  vite?: boolean

  /* repository */
  license?: string // license in package.json
  repository?: string // repository in package.json
  author?: string // author in package.json
  homepage?: string // homepage in package.json

  /* custom */
  custom_scripts?: Record<string, string> // append fields in scripts filed
  custom_dependencies?: Record<string, string> // append fields in dependencies filed
  custom_dev_dependencies?: Record<string, string> // append fields in devDependencies filed
  custom_package_json_fields: Record<string, any> // overwrite fields in package.json
}

Usage

import { genConfigFiles } from '@block-dev/create-config';

genConfigFiles({
  main: true,
  ts: true,
  ts_esm: true,
  airbnb: true,
  husky: true,
  lint_staged: true,
  commitlint: true,
  // commitlint options
  scope: true,
  type_enum: true,
  scope_min: 3,
  subject_min: 5,
  // inject custom eslint rules
  eslint_rules: {
    '@typescript-eslint/naming-convention': 0,
  },
  license: 'MIT',
  author: 'OrekiSH <[email protected]> (https://github.com/OrekiSH)',
  repository: 'https://github.com/OrekiSH/block-dev',
});

@block-dev/create-block

๐Ÿ”จ Scaffolding a well linted project

Usage

npm init @block-dev/block@latest
# OR
yarn create @block-dev/block
# OR
pnpx @block-dev/create-block

block-dev's People

Contributors

orekish avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.