UNPKG

config-oclock

Version:

Config O'clock (eslint, babel, prettier, ...) which have same packages and configuration in front and back side

115 lines (85 loc) 2.33 kB
# Config O'clock **We define all eslint rules in this project.** This config contains several common utility, like : * Babel * ESLint * Mocha * Chai * Sinon * Husky * Prettier * Lint-staged ## Config React * If you're using this config with a **React** project, * Also, download [config-oclock-front](https://www.npmjs.com/package/config-oclock-front). * In **your project**, add this config in `.eslintrc` : ```json { "extends": [ "./node_modules/config-oclock/eslint.js", "./node_modules/config-oclock-front/eslint.js" ] } ``` * Create a `.babelrc` and add this : ```json { "extends": "./node_modules/config-oclock-front/.babelrc" } ``` * Create a file `brunch-config.js` at root of your project, and add this : ```js const package = require('./package.json'); const brunchConfig = require('config-oclock-front/brunch'); exports.config = brunchConfig(package, { // You can overRide Brunch's config here. // For example, if you want run Brunch on another port server: { port: 3335 } }); ``` ## Config Node.js * Or, with a **Node.js** project, * Also, download [config-oclock-back](https://www.npmjs.com/package/config-oclock-back), * In **your project**, add this config in `.eslintrc` : ```json { "extends": [ "./node_modules/config-oclock/eslint.js", "./node_modules/config-oclock-back/eslint.js" ] } ``` * Create a `.babelrc` and add this : ```json { "extends": "./node_modules/config-oclock-back/.babelrc" } ``` --- ## Others config **You need use this config with one of both.** If you're using **React** : this [config-oclock-front](https://www.npmjs.com/package/config-oclock-front) is made for you ! That will install these packages : **Brunch** + Auto Reload Brunch + Brunch + Clean CSS Brunch + Stylus Brunch + Uglify JS Brunch **Babel** + Babel-brunch + Babel-plugin-glamorous-displayname + Babel-plugin-transform-react-remove-prop-types + Babel-preset-react **Tests** + Enzyme, + Adapter for React 16 + Enzyme Redux + JSDom + Node Localstorage + React test renderer + Redux test utils Or, if you're using **Node.js** : you should use this [config-oclock-back](https://www.npmjs.com/package/config-oclock-back). That will install these packages : * Babel-cli * Nodemon * Supertest