Skip to content

Instantly share code, notes, and snippets.

@marharyta
Last active July 17, 2018 09:51
Show Gist options
  • Save marharyta/277f77714fd8893e3b91ddbaa0a16341 to your computer and use it in GitHub Desktop.
Save marharyta/277f77714fd8893e3b91ddbaa0a16341 to your computer and use it in GitHub Desktop.
React-redux search
{
"presets": ["env", "react"]
}
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'prettier',
'plugin:prettier/recommended'
],
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: ['react', 'prettier'],
rules: {
indent: ['error', 2],
'linebreak-style': ['error', 'unix'],
quotes: ['warn', 'single'],
semi: ['error', 'always'],
'no-unused-vars': [
'warn',
{ vars: 'all', args: 'none', ignoreRestSiblings: false }
],
'prettier/prettier': 'error'
}
};
{
"name": "webpack-boilerplate",
"version": "1.0.0",
"main": "index.js",
"repository": "[email protected]:marharyta/webpack-boilerplate.git",
"author": "Margarita Obraztsova <[email protected]>",
"license": "MIT",
"scripts": {
"dev": "NODE_ENV=development webpack-dev-server --mode=development --hot"
},
"dependencies": {
"autoprefixer": "^8.6.3",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"clean-webpack-plugin": "^0.1.19",
"css-loader": "^0.28.11",
"eslint": "^5.0.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.6.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.4.0",
"node-sass": "^4.9.0",
"postcss-loader": "^2.1.5",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"sass-loader": "^7.0.3",
"style-loader": "^0.21.0",
"stylelint": "^9.3.0",
"stylelint-config-recommended": "^2.1.0",
"stylelint-webpack-plugin": "^0.10.5",
"webpack": "^4.12.0",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4",
"webpack-md5-hash": "^0.0.6",
"yarn": "^1.7.0"
}
}
module.exports = {
plugins: [
require('autoprefixer')
]
}
module.exports = {
printWidth: 80,
tabWidth: 2,
semi: true,
singleQuote: true,
bracketSpacing: true
};
module.exports = {
extends: ['stylelint-config-recommended'],
rules: {
'color-no-invalid-hex': true,
'font-family-no-duplicate-names': true,
'function-calc-no-unspaced-operator': true,
'unit-no-unknown': true,
'block-no-empty': true,
'selector-pseudo-class-no-unknown': true,
'selector-pseudo-element-no-unknown': true,
'media-feature-name-no-unknown': true,
'at-rule-no-unknown': true,
'comment-no-empty': true,
'no-duplicate-at-import-rules': true,
'no-extra-semicolons': true,
'no-invalid-double-slash-comments': true,
'declaration-no-important': true,
'declaration-block-single-line-max-declarations': 1,
'max-nesting-depth': 5,
'number-leading-zero': 'always',
'number-no-trailing-zeros': true,
'string-quotes': 'single',
'unit-case': 'lower',
'value-list-max-empty-lines': 0,
'property-case': 'lower',
'declaration-colon-space-after': 'always',
'declaration-colon-space-before': 'never',
'declaration-block-semicolon-newline-after': 'always-multi-line',
'declaration-block-semicolon-space-before': 'never',
'declaration-block-trailing-semicolon': 'always',
'block-opening-brace-space-before': 'always',
'selector-pseudo-class-case': 'lower',
'selector-pseudo-element-case': 'lower',
'selector-type-case': 'lower',
'media-feature-colon-space-after': 'always',
'media-feature-colon-space-before': 'never',
'media-feature-name-case': 'lower',
'comment-whitespace-inside': 'always'
}
};
// webpack v4
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const WebpackMd5Hash = require('webpack-md5-hash');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const StyleLintPlugin = require('stylelint-webpack-plugin');
module.exports = {
entry: { main: './src/index.js' },
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].[hash].js'
},
devtool: 'inline-source-map',
devServer: {
contentBase: './dist',
open: true,
hot: true
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.css$/,
use: [
'style-loader',
MiniCssExtractPlugin.loader,
'css-loader',
'postcss-loader'
]
}
]
},
plugins: [
new CleanWebpackPlugin('dist', {}),
new MiniCssExtractPlugin({
filename: 'style.[contenthash].css'
}),
new HtmlWebpackPlugin({
inject: false,
hash: true,
template: './src/index.html',
filename: 'index.html'
}),
new WebpackMd5Hash(),
new StyleLintPlugin({
configFile: './stylelint.config.js',
files: './src/css/*.css'
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment