Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

Commit

Permalink
feat: Move tooling configs to package.json
Browse files Browse the repository at this point in the history
This way we can get rid of the following files:

```
/.babelrc
/.eslintrc.json
/.prettierrc
/.stylelintrc.json
/baumeister.json
```

It’s a trend that tools make it possible to store their settings in a field in the `package.json`. I recently enabled Baumeister to handle his configuration this way. See [#270 – feat: enable to define baumeister config in package.json](#270).

I’d like the approach, because the project root is less cluttered with dotfiles and you can see all the configs in one place.
  • Loading branch information
mischah authored Feb 18, 2019
1 parent 217bdd2 commit ab6594c
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 124 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

19 changes: 0 additions & 19 deletions .eslintrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions .prettierrc

This file was deleted.

24 changes: 0 additions & 24 deletions .stylelintrc.json

This file was deleted.

38 changes: 0 additions & 38 deletions baumeister.json

This file was deleted.

160 changes: 160 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,134 @@
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.1.1"
},
"baumeister": {
"useHandlebars": true,
"purifyCSS": {
"usePurifyCSS": false,
"whitelist": [
"*navbar*",
"*modal*",
"*dropdown*",
"*carousel*",
"*tooltip*",
"open",
"fade",
"collapse",
"collapsing",
"in"
]
},
"generateBanners": false,
"cacheBusting": true,
"vendor": {
"bundleCSS": [],
"includeStaticFiles": []
},
"webpack": {
"DefinePlugin": {
"development": {
"PRODUCTION": false
},
"production": {
"PRODUCTION": true
}
},
"ProvidePlugin": {
"$": "jquery",
"jQuery": "jquery"
}
}
},
"babel": {
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-proposal-object-rest-spread"
],
"overrides": [
{
"include": "./src/app/**",
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
]
],
"env": {
"test": {
"presets": [
[
"@babel/preset-env",
{
"modules": "commonjs"
}
]
]
}
},
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime",
"@babel/plugin-transform-regenerator",
[
"transform-imports",
{
"lodash": {
"transform": "lodash/${member}",
"preventFullImport": true
},
"reactstrap": {
"transform": "reactstrap/lib/${member}",
"preventFullImport": true
},
"react-bootstrap": {
"transform": "react-bootstrap/lib/${member}",
"preventFullImport": true
},
"react-router": {
"transform": "react-router/${member}",
"preventFullImport": true
}
}
]
]
}
]
},
"eslintConfig": {
"extends": [
"baumeister",
"prettier",
"prettier/unicorn",
"prettier/react"
],
"parser": "babel-eslint",
"parserOptions": {
"allowImportExportEverywhere": true
},
"globals": {
"PRODUCTION": false
},
"overrides": [
{
"files": [
"build/*.js"
],
"rules": {
"no-console": "off",
"unicorn/no-process-exit": "off"
}
}
]
},
"prettier": {
"singleQuote": true,
"jsxBracketSameLine": true
},
"jest": {
"testURL": "http://localhost",
"testPathIgnorePatterns": [
Expand All @@ -154,6 +282,38 @@
"text-summary"
]
},
"stylelint": {
"extends": [
"stylelint-config-standard",
"stylelint-config-prettier"
],
"rules": {
"number-leading-zero": [
"always",
{
"severity": "warning"
}
],
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": [
"extend",
"mixin",
"include",
"at-root",
"debug",
"warn",
"error",
"if",
"for",
"each",
"while"
]
}
]
}
},
"husky": {
"hooks": {
"post-merge": "npm install",
Expand Down
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = ({ file, options, env }) => ({
autoprefixer: options.autoprefixer,
/**
* Need to disable minification when using PurifyCSS because using PurifyCSS
* on minified CSS disn’t work out. PurifyCSS has a minify option wich is
* on minified CSS doesn’t work out. PurifyCSS has a minify option which is
* used instead.
*/
cssnano:
Expand Down
35 changes: 0 additions & 35 deletions src/app/.babelrc

This file was deleted.

0 comments on commit ab6594c

Please sign in to comment.