Guest User

Untitled

a guest
Jan 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.76 KB | None | 0 0
  1. "babel-eslint": "^7.2.3",
  2. "eslint": "^4.19",
  3. "eslint-loader": "^1.8.0",
  4. "eslint-plugin-react": "^7.1.0"
  5.  
  6. {
  7. "devDependencies": {
  8. "@babel/cli": "^7.2.3",
  9. "@babel/core": "^7.1.0",
  10. "@babel/plugin-proposal-object-rest-spread": "^7.2.0",
  11. "@babel/polyfill": "^7.2.5",
  12. "@babel/preset-env": "^7.1.0",
  13. "@babel/preset-react": "^7.0.0",
  14. "babel-core": "7.0.0-bridge.0",
  15. "babel-eslint": "^10.0.1",
  16. "babel-jest": "^21.2.0",
  17. "babel-loader": "^8.0.2",
  18. "enzyme": "^3.8.0",
  19. "eslint": "^5.12.0",
  20. "eslint-loader": "^2.1.1",
  21. "eslint-plugin-react": "^7.12.4",
  22. "extract-text-webpack-plugin": "^4.0.0-beta.0",
  23. "jest": "^21.2.1",
  24. "mini-css-extract-plugin": "^0.5.0",
  25. "react-sortable-hoc": "^1.4.0",
  26. "react-test-renderer": "^16.7.0",
  27. "sinon": "^7.2.2",
  28. "webpack": "^4.28.4",
  29. "webpack-cli": "^3.2.1",
  30. "webpack-dev-server": "^3.1.14",
  31. "webpack-node-externals": "^1.7.2"
  32. },
  33. ...
  34. "scripts": {
  35. ...
  36. "lint": "eslint 'app/**'",
  37. }
  38. }
  39.  
  40. const path = require('path');
  41. const webpack = require('webpack');
  42. const ExtractTextPlugin = require('extract-text-webpack-plugin');
  43.  
  44.  
  45. module.exports = env =>
  46. {
  47. const developMode = (env && env.dev);
  48. const watch = developMode;
  49.  
  50. return {
  51. mode: (developMode ? 'development' : 'production'),
  52. context: path.resolve(__dirname, './app'),
  53. module: {
  54. rules: [
  55. {
  56. test: /.m?js$/,
  57. exclude: /node_modules/,
  58. use: {
  59. loader: 'babel-loader',
  60. options: {
  61. plugins: [
  62. '@babel/plugin-proposal-object-rest-spread'
  63. ],
  64. presets: [
  65. '@babel/preset-env',
  66. '@babel/preset-react'
  67. ]
  68. }
  69. }
  70. },
  71. {
  72. test: /.jsx?$/,
  73. use: [
  74. {
  75. loader: 'eslint-loader'
  76. }
  77. ],
  78. exclude: /node_modules/
  79. },
  80. {
  81. test: /.scss$/,
  82. include: /.scss$/,
  83. loaders: ExtractTextPlugin.extract({
  84. fallback: 'style-loader',
  85. use: 'css-loader!sass-loader',
  86. }),
  87. },
  88. {
  89. test: /.css$/,
  90. exclude: /.scss$/,
  91. use: ['style-loader', 'css-loader']
  92. },
  93. ]
  94. },
  95. entry: {
  96. 'js/app.file1.js': './exports/file1.js',
  97. 'js/app.file2.js': './exports/file2.js',
  98. 'css/app.file1.css': './styles/file1.scss',
  99. 'css/app.file2.css': './styles/file2.scss'
  100. },
  101. output: {
  102. path: path.resolve(__dirname, './assets'),
  103. filename: '[name]'
  104. },
  105. performance: {
  106. hints: false,
  107. },
  108. resolve: {
  109. modules: [
  110. path.resolve('./app'),
  111. 'node_modules'
  112. ]
  113. },
  114. plugins: [
  115. new ExtractTextPlugin({
  116. filename: '[name]'
  117. })
  118. ],
  119. watch: watch
  120. };
  121. };
  122.  
  123. {
  124. "extends": [
  125. "eslint:recommended",
  126. "plugin:react/recommended"
  127. ],
  128. "env": {
  129. "browser": true,
  130. "es6": true
  131. },
  132. "globals": {
  133. "apiRequest": true,
  134. "$": true,
  135. "launchModal": true,
  136. "Promise": true,
  137. "toastr": true,
  138. "localStorage": true
  139. },
  140. "parser": "babel-eslint",
  141. "plugins": [
  142. "react"
  143. ],
  144. "parserOptions": {
  145. "ecmaFeatures": {
  146. "jsx": true
  147. },
  148. "ecmaVersion": 2018,
  149. "sourceType": "module"
  150. },
  151. "rules": {
  152. "camelcase": [
  153. "error",
  154. {
  155. "properties": "never"
  156. }
  157. ],
  158. "curly": "error",
  159. "for-direction": "error",
  160. "global-require": "error",
  161. "indent": [
  162. "error",
  163. 4,
  164. {
  165. "SwitchCase": 1,
  166. "ignoredNodes": [
  167. "JSXAttribute",
  168. "JSXSpreadAttribute"
  169. ]
  170. }
  171. ],
  172. "key-spacing": [
  173. "error",
  174. {
  175. "beforeColon": false,
  176. "afterColon": true,
  177. "mode": "strict"
  178. }
  179. ],
  180. "no-case-declarations": "off",
  181. "no-confusing-arrow": [
  182. "error",
  183. {
  184. "allowParens": false
  185. }
  186. ],
  187. "no-multi-spaces": "error",
  188. "no-trailing-spaces": "error",
  189. "no-unused-expressions": "error",
  190. "no-var": "error",
  191. "no-whitespace-before-property": "error",
  192. "padding-line-between-statements": [
  193. "error",
  194. {
  195. "blankLine": "always",
  196. "prev": "*",
  197. "next": [
  198. "block-like",
  199. "function",
  200. "multiline-block-like",
  201. "return"
  202. ]
  203. }
  204. ],
  205. "quotes": [
  206. "error",
  207. "single"
  208. ],
  209. "react/class-methods-use-this": "off",
  210. "react/jsx-filename-extension": "off",
  211. "react/jsx-no-bind": "off",
  212. "react/jsx-sort-props": [
  213. "error",
  214. {
  215. "shorthandFirst": true,
  216. "callbacksLast": true
  217. }
  218. ],
  219. "react/jsx-uses-react": "error",
  220. "react/jsx-uses-vars": "error",
  221. "react/jsx-wrap-multilines": "off",
  222. "react/prefer-stateless-function": "off",
  223. "react/prop-types": "off",
  224. "react/react-in-jsx-scope": "off",
  225. "react/require-default-props": "off",
  226. "react/sort-comp": "error",
  227. "semi": [
  228. "error",
  229. "always"
  230. ],
  231. "sort-imports": [
  232. "error",
  233. {
  234. "ignoreCase": true
  235. }
  236. ],
  237. "space-before-blocks": [
  238. "error",
  239. "always"
  240. ]
  241. },
  242. "settings": {
  243. "react": {
  244. "version": "detect"
  245. }
  246. }
  247. }
Add Comment
Please, Sign In to add comment