@sigmadigital/configs
common JS configs for eslint, prettier, babel and stylelint
Last updated a year ago by pushplaybang .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @sigmadigital/configs 
SYNC missed versions from official npm registry.

Configs

this is specifically a single importable npm package that centralises our common configs for javascript development, including:

  • eslint
  • babel
  • prettier
  • stylelint

It also contains basic config files, that should be placed in the root of the project when installed.

Get Started

While your project will require some root dependencies to be installed, this package should vastly simplify the rather arduous task of setting this up and maintaining these configs across multiple projects.

Requirements

  #devDependencies
   @babel/cli@">= 7.0.0"
   @babel/core@">= 7.0.0"
   eslint@">= 5"
   jest@">= 24"
   prettier@">= 1.16.1"
   flow-bin@">= 0.91"
   
   # dependencies
   @babel/polyfill@">= 7.0.0"
   @babel/runtime@">= 7.3"

Install

you can either just install this package:

npm install --save-dev @sigmadigital/configs

or alternatively, install this package with all its dependencies with the following commands.

npm install --save-dev @babel/cli@">=7.0.0" @babel/core@">=7.0.0" eslint@">=5" jest@">=24" prettier@">=1.16.1" flow-bin@">=0.91" @sigmadigital/configs 

npm install --save @babel/polyfill@">=7.0.0"  @babel/runtime@">= 7.3"

Config files

If config files don't exist, they will be added to the project root, alternatively, you can use the following presets:

// .babelrc
@sigmadigital/configs/presets/babel

// .babelrc (next JS after babel/next)
@sigmadigital/configs/presets/babel/next

// .stylelintrc
@sigmadigital/configs/presets/stylelint

// .eslint.json
@sigmadigital/eslint-config-kitchensink

// .prettierrc.js 
module.exports = require('@sigmadigital/configs/presets/prettier');

you can inspect the default project config files that should be used in the root in the ./configFiles directory.

Example Scripts

it will be useful to add these to the scripts section of your package.json:

{
  "scripts": {
    "lint": "npm run lint:js && npm run lint:scss",
    "lint:js": "eslint \"assets/js/**\"",
    "lint:scss": "stylelint \"assets/scss/*.scss\"",
    "codestyle": "npm run codestyle:fix && npm run codestyle:prettier",
    "codestyle:fix": "npm run codestyle:fix:js && npm run codestyle:fix:scss",
    "codestyle:fix:js": "eslint --fix \"assets/**/*.js\"",
    "codestyle:fix:scss": "stylelint \"assets/**/*.scss\" --fix",
    "codestyle:prettier": "npm run codestyle:prettier:js && npm run codestyle:prettier:scss",
    "codestyle:prettier:js": "prettier --write \"assets/**/*.js\"",
    "codestyle:prettier:scss": "prettier --write \"assets/**/*.scss\""
  }
}

Use At Your Own Risk

While this is openly available and licensed under MIT, we have developed it solely for our own purposes, and provide zero warranties, or guarantees of any kind.

Contributing

If you find a bug, have a suggestion, or would like to contribute, head on over the issues section on the github repo.

Current Tags

  • 0.3.5                                ...           latest (a year ago)

24 Versions

  • 0.3.5                                ...           a year ago
  • 0.3.4                                ...           a year ago
  • 0.3.3                                ...           a year ago
  • 0.3.2                                ...           a year ago
  • 0.3.1                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.14                                ...           a year ago
  • 0.0.13                                ...           a year ago
  • 0.0.12                                ...           a year ago
  • 0.0.11                                ...           a year ago
  • 0.0.10                                ...           a year ago
  • 0.0.9                                ...           a year ago
  • 0.0.8                                ...           a year ago
  • 0.0.7                                ...           a year ago
  • 0.0.6                                ...           a year ago
  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago

Copyright 2014 - 2017 © taobao.org |