├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .husky └── .gitignore ├── .npmignore ├── .prettierignore ├── .prettierrc ├── .yarn └── releases │ └── yarn-1.19.1.js ├── .yarnrc ├── CHANGELOG.md ├── README.md ├── babel.config.js ├── commitlint.config.js ├── husky.config.js ├── lerna.json ├── package.json ├── packages ├── babel-preset │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ └── package.json ├── eslint-config │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ ├── jest.js │ ├── package.json │ ├── react.js │ └── ts.js ├── session │ ├── .eslintrc │ ├── CHANGELOG.md │ ├── README.md │ ├── index.d.ts │ ├── package.json │ ├── src │ │ ├── cookies.ts │ │ ├── index.ts │ │ ├── localStorage.ts │ │ └── sessionStorage.ts │ └── tsconfig.json └── webpack │ ├── CHANGELOG.md │ ├── README.md │ ├── index.cjs │ ├── package.json │ ├── parts │ ├── dev.cjs │ ├── prod.cjs │ └── shared.cjs │ └── server.cjs ├── renovate.json ├── tsconfig.json └── yarn.lock /.eslintignore: -------------------------------------------------------------------------------- 1 | docs 2 | node_modules 3 | 4 | # build 5 | packages/*/index.d.ts 6 | packages/*/lib 7 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ["@reactizer"], 3 | env: { 4 | node: true 5 | }, 6 | overrides: [ 7 | { 8 | files: ["*.ts", "*.tsx"], 9 | extends: ["@reactizer/eslint-config/ts"], 10 | parserOptions: { 11 | project: "./tsconfig.json", 12 | }, 13 | }, 14 | ], 15 | }; 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .atom 2 | .cache 3 | .idea 4 | coverage 5 | node_modules 6 | es 7 | lib 8 | dist 9 | .DS_Store 10 | .env 11 | npm-debug.log 12 | stats.json 13 | lerna-debug.log 14 | yarn-error.log 15 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .yarn 2 | CHANGELOG.md 3 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | yarn-path ".yarn/releases/yarn-1.19.1.js" 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.26.0](https://github.com/oreqizer/reactizer/compare/v0.25.0...v0.26.0) (2019-12-16) 7 | 8 | 9 | ### Features 10 | 11 | * **boil-urql:** firebase ([9d80de1](https://github.com/oreqizer/reactizer/commit/9d80de1d6d16bc2a03ca9edfd59763ea41999a98)) 12 | 13 | 14 | 15 | 16 | 17 | # [0.25.0](https://github.com/oreqizer/reactizer/compare/v0.24.5...v0.25.0) (2019-12-15) 18 | 19 | 20 | ### Features 21 | 22 | * **session:** implement ([6d76aff](https://github.com/oreqizer/reactizer/commit/6d76affd6d9260036a4b8515498d00e4e2c937b7)) 23 | * **theme:** add babel plugin styled components ([f75a3eb](https://github.com/oreqizer/reactizer/commit/f75a3eb9fdd006714a6af04bb640f26956b07ccc)) 24 | 25 | 26 | 27 | 28 | 29 | ## [0.24.5](https://github.com/oreqizer/reactizer/compare/v0.24.4...v0.24.5) (2019-12-15) 30 | 31 | **Note:** Version bump only for package reactizer 32 | 33 | 34 | 35 | 36 | 37 | ## [0.24.4](https://github.com/oreqizer/reactizer/compare/v0.24.3...v0.24.4) (2019-12-15) 38 | 39 | **Note:** Version bump only for package reactizer 40 | 41 | 42 | 43 | 44 | 45 | ## [0.24.3](https://github.com/oreqizer/reactizer/compare/v0.24.2...v0.24.3) (2019-12-15) 46 | 47 | 48 | ### Bug Fixes 49 | 50 | * **boil-base:** absolute path ([a49e6da](https://github.com/oreqizer/reactizer/commit/a49e6da163dda2071e7f6816c27cf61de3f67c6a)) 51 | 52 | 53 | 54 | 55 | 56 | ## [0.24.2](https://github.com/oreqizer/reactizer/compare/v0.24.1...v0.24.2) (2019-12-15) 57 | 58 | 59 | ### Bug Fixes 60 | 61 | * **webpack:** don't open ([165bf6d](https://github.com/oreqizer/reactizer/commit/165bf6dc79a793bac5651f7d44486fffbed36142)) 62 | 63 | 64 | 65 | 66 | 67 | ## [0.24.1](https://github.com/oreqizer/reactizer/compare/v0.24.0...v0.24.1) (2019-12-15) 68 | 69 | 70 | ### Bug Fixes 71 | 72 | * **meta:** ts config ([bbc90f5](https://github.com/oreqizer/reactizer/commit/bbc90f555ea1b0efdda7be232ac8ad2fd16fa696)) 73 | 74 | 75 | 76 | 77 | 78 | # [0.24.0](https://github.com/oreqizer/reactizer/compare/v0.23.0...v0.24.0) (2019-12-15) 79 | 80 | 81 | ### Features 82 | 83 | * **boil-urql:** add a bunch of apollo codegen ([660a99a](https://github.com/oreqizer/reactizer/commit/660a99a26cf7031d37e4d107c63a7a7674b20d01)) 84 | * **boil-urql:** ssr and stuff ([b879326](https://github.com/oreqizer/reactizer/commit/b87932631d40ec6ed5205a151af0cade39d01db4)) 85 | 86 | 87 | 88 | 89 | 90 | # [0.23.0](https://github.com/oreqizer/reactizer/compare/v0.22.0...v0.23.0) (2019-12-14) 91 | 92 | 93 | ### Features 94 | 95 | * **urql:** add schema download ([b80ec44](https://github.com/oreqizer/reactizer/commit/b80ec449e6998e4c8ab2cd8e6577c0853e85e1b4)) 96 | 97 | 98 | 99 | 100 | 101 | # [0.22.0](https://github.com/oreqizer/reactizer/compare/v0.21.4...v0.22.0) (2019-12-12) 102 | 103 | 104 | ### Features 105 | 106 | * **urql:** set up Urql and graphql-tag ([dda629e](https://github.com/oreqizer/reactizer/commit/dda629ec76ba85e02c741d0560d0c666c02620b7)) 107 | 108 | 109 | 110 | 111 | 112 | ## [0.21.4](https://github.com/oreqizer/reactizer/compare/v0.21.3...v0.21.4) (2019-12-12) 113 | 114 | **Note:** Version bump only for package reactizer 115 | 116 | 117 | 118 | 119 | 120 | ## [0.21.3](https://github.com/oreqizer/reactizer/compare/v0.21.2...v0.21.3) (2019-12-09) 121 | 122 | **Note:** Version bump only for package reactizer 123 | 124 | 125 | 126 | 127 | 128 | ## [0.21.2](https://github.com/oreqizer/reactizer/compare/v0.21.1...v0.21.2) (2019-12-09) 129 | 130 | **Note:** Version bump only for package reactizer 131 | 132 | 133 | 134 | 135 | 136 | ## [0.21.1](https://github.com/oreqizer/reactizer/compare/v0.21.0...v0.21.1) (2019-12-09) 137 | 138 | 139 | ### Bug Fixes 140 | 141 | * **boil-base:** remove stories ([430ce61](https://github.com/oreqizer/reactizer/commit/430ce61d72cccbae6cef290db76656001e3c5d77)) 142 | 143 | 144 | 145 | 146 | 147 | # [0.21.0](https://github.com/oreqizer/reactizer/compare/v0.20.0...v0.21.0) (2019-12-09) 148 | 149 | 150 | ### Features 151 | 152 | * **theme:** init ([13d636d](https://github.com/oreqizer/reactizer/commit/13d636de051f367328334000bebbf45ae321a72a)) 153 | 154 | 155 | 156 | 157 | 158 | # [0.20.0](https://github.com/oreqizer/reactizer/compare/v0.19.2...v0.20.0) (2019-12-09) 159 | 160 | 161 | ### Features 162 | 163 | * **intl:** init ([ec2f900](https://github.com/oreqizer/reactizer/commit/ec2f9002f351aa49b03a13e3d6684de0d077bf9d)) 164 | 165 | 166 | 167 | 168 | 169 | ## [0.19.2](https://github.com/oreqizer/reactizer/compare/v0.19.0...v0.19.2) (2019-12-08) 170 | 171 | 172 | ### Bug Fixes 173 | 174 | * **boil-relay:** add relay plugin to eslint ([8ac5871](https://github.com/oreqizer/reactizer/commit/8ac58714626ab1cd57cd11b6daaa54e84ba6910a)) 175 | * **eslint-config:** remove relay plugin ([2323890](https://github.com/oreqizer/reactizer/commit/2323890c5b6792e1741d9b0ca9f39c2a01853356)) 176 | 177 | 178 | 179 | 180 | 181 | ## [0.19.1](https://github.com/oreqizer/reactizer/compare/v0.19.0...v0.19.1) (2019-12-08) 182 | 183 | 184 | ### Bug Fixes 185 | 186 | * **eslint-config:** remove relay plugin ([2323890](https://github.com/oreqizer/reactizer/commit/2323890c5b6792e1741d9b0ca9f39c2a01853356)) 187 | 188 | 189 | 190 | 191 | 192 | # [0.19.0](https://github.com/oreqizer/reactizer/compare/v0.18.1...v0.19.0) (2019-12-08) 193 | 194 | 195 | ### Features 196 | 197 | * **meta:** prefix boilerplates with 'boil' ([91466c9](https://github.com/oreqizer/reactizer/commit/91466c9cd7156d0c1df8d6a642ac38c5d98d614a)) 198 | * **urql:** add ([5a35022](https://github.com/oreqizer/reactizer/commit/5a350220c83b7c16742f9a1cd0b3972b2bd69611)) 199 | 200 | 201 | 202 | 203 | 204 | ## [0.18.1](https://github.com/oreqizer/reactizer/compare/v0.18.0...v0.18.1) (2019-12-08) 205 | 206 | **Note:** Version bump only for package reactizer 207 | 208 | 209 | 210 | 211 | 212 | # [0.18.0](https://github.com/oreqizer/reactizer/compare/v0.17.0...v0.18.0) (2019-12-03) 213 | 214 | 215 | ### Bug Fixes 216 | 217 | * **babel-preset:** remove relay ([fd8ca38](https://github.com/oreqizer/reactizer/commit/fd8ca38c8225d9499b4f11bf362ca107cbdcf10c)) 218 | 219 | 220 | ### Features 221 | 222 | * **meta:** add @reactizer/webpack ([7b89939](https://github.com/oreqizer/reactizer/commit/7b8993946072496a4ea437470571aa65eebc5126)) 223 | 224 | 225 | 226 | 227 | 228 | # [0.17.0](https://github.com/oreqizer/reactizer/compare/v0.16.1...v0.17.0) (2019-12-03) 229 | 230 | 231 | ### Bug Fixes 232 | 233 | * **relay:** babel config ([1cf5ab5](https://github.com/oreqizer/reactizer/commit/1cf5ab509182b0a48315a38e9d1518075e6838e5)) 234 | 235 | 236 | ### Features 237 | 238 | * **meta:** faster Gitlab ([f242f2d](https://github.com/oreqizer/reactizer/commit/f242f2d3cb31f00a4709bed5199a9968489ebc42)) 239 | * **meta:** init babel-preset ([574710a](https://github.com/oreqizer/reactizer/commit/574710ad134ffa631f978a888fbdfc38d0568dcc)) 240 | 241 | 242 | 243 | 244 | 245 | ## [0.16.1](https://github.com/oreqizer/reactizer/compare/v0.16.0...v0.16.1) (2019-11-21) 246 | 247 | 248 | ### Bug Fixes 249 | 250 | * **cli:** correct app ([71aaac8](https://github.com/oreqizer/reactizer/commit/71aaac81ad37b7abad1aa00539c35b0b7cc3dccb)) 251 | 252 | 253 | 254 | 255 | 256 | # [0.16.0](https://github.com/oreqizer/reactizer/compare/v0.15.1...v0.16.0) (2019-11-21) 257 | 258 | 259 | ### Features 260 | 261 | * **cli:** do not default the app ([60f31ec](https://github.com/oreqizer/reactizer/commit/60f31ec6c82b449047e62b36872deccde45a666a)) 262 | 263 | 264 | 265 | 266 | 267 | ## [0.15.1](https://github.com/oreqizer/reactizer/compare/v0.15.0...v0.15.1) (2019-11-21) 268 | 269 | 270 | ### Bug Fixes 271 | 272 | * **relay:** eslint ([bee45cd](https://github.com/oreqizer/reactizer/commit/bee45cd182d627062279c5b6cddccc36d340bde3)) 273 | 274 | 275 | ### Features 276 | 277 | * **meta:** independent versions ([9ab2aeb](https://github.com/oreqizer/reactizer/commit/9ab2aeb4f67c76c8e5405986ba58ead6da6a31f7)) 278 | * **meta:** not independent versions ([f3559b4](https://github.com/oreqizer/reactizer/commit/f3559b49de50880b356689aa79b4e457fcbd09cc)) 279 | 280 | 281 | 282 | 283 | 284 | # [0.15.0](https://github.com/oreqizer/reactizer/compare/v0.14.0...v0.15.0) (2019-11-21) 285 | 286 | 287 | ### Bug Fixes 288 | 289 | * **meta:** eslintignores ([91056ac](https://github.com/oreqizer/reactizer/commit/91056ac21284d9249f228a7da5b5e9a2f2158b6b)) 290 | 291 | 292 | ### Features 293 | 294 | * **meta:** minor release cleanup ([157b2d6](https://github.com/oreqizer/reactizer/commit/157b2d66435d162f10dc232daaea46a95b43f1d2)) 295 | * **meta:** remove react hot loader ([c7765be](https://github.com/oreqizer/reactizer/commit/c7765be9b81e19cb47a0db628ce3007884787331)) 296 | * **relay:** turn off rules contradicting Relay flow ([cc99f5f](https://github.com/oreqizer/reactizer/commit/cc99f5f55facbeba315a5e3eb0cb8f08a0d620c2)) 297 | 298 | 299 | 300 | 301 | 302 | # [0.14.0](https://github.com/oreqizer/reactizer/compare/v0.13.1...v0.14.0) (2019-11-20) 303 | 304 | 305 | ### Features 306 | 307 | * **eslint:** init ([af35a8a](https://github.com/oreqizer/reactizer/commit/af35a8a607f3cc16231b183e23033fb83637c742)) 308 | 309 | 310 | 311 | 312 | 313 | ## [0.13.1](https://github.com/oreqizer/reactizer/compare/v0.12.6...v0.13.1) (2019-11-15) 314 | 315 | 316 | ### Features 317 | 318 | * **meta:** new package, cleanup ([19e3fa3](https://github.com/oreqizer/reactizer/commit/19e3fa3482312a5878b452397a2fee77f39cfa32)) 319 | 320 | 321 | 322 | 323 | 324 | # [0.12.0](https://github.com/oreqizer/reactizer/compare/v0.11.2...v0.12.0) (2019-11-15) 325 | 326 | 327 | ### Bug Fixes 328 | 329 | * **meta:** Updater bin ([d8cafeb](https://github.com/oreqizer/reactizer/commit/d8cafebf123d5dd611c213e0615ba57d824331e8)) 330 | 331 | 332 | ### Features 333 | 334 | * **meta:** cleanup, ready for initial release ([832a6f9](https://github.com/oreqizer/reactizer/commit/832a6f96e290802aed500da4f7b3c55f2575fca4)) 335 | * **meta:** Monorepo ([d1a732a](https://github.com/oreqizer/reactizer/commit/d1a732a876c6eb33bf21837dc7172ccb2c2ed3b0)) 336 | * **meta:** Updater bin ([aae4a9b](https://github.com/oreqizer/reactizer/commit/aae4a9be07181c07f95d38bee505d9d9920d6ab2)) 337 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Reactizer 2 | 3 | Collection of the best **React** tools and boilerplates! 4 | 5 | ## Release 6 | 7 | Make nice fucking commits. 8 | 9 | - `yarn lerna publish` 10 | 11 | ## License 12 | 13 | MIT 14 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = (api) => { 2 | api.cache(true); 3 | 4 | const targets = { browsers: "> 0.25%, not dead" }; 5 | const modules = process.env.BABEL_ENV === "modules" ? false : "auto"; 6 | 7 | return { 8 | presets: [ 9 | "@babel/react", 10 | "@babel/typescript", 11 | ["@babel/env", { loose: true, targets, modules }], 12 | ], 13 | plugins: [ 14 | "@babel/plugin-transform-runtime", 15 | "@babel/plugin-proposal-class-properties", 16 | "@babel/plugin-proposal-optional-chaining", 17 | "@babel/plugin-proposal-nullish-coalescing-operator", 18 | "@babel/plugin-transform-react-constant-elements", 19 | ], 20 | }; 21 | }; 22 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | 3 | const packages = fs.readdirSync("packages"); 4 | 5 | module.exports = { 6 | extends: ["@commitlint/config-conventional"], 7 | rules: { 8 | "scope-enum": [2, "always", ["dev", ...packages]], 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /husky.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | hooks: { 3 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", 4 | "pre-push": "yarn ci", 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "independent", 3 | "npmClient": "yarn", 4 | "useWorkspaces": true, 5 | "command": { 6 | "version": { 7 | "message": "chore(meta): publish", 8 | "allowBranch": "master", 9 | "conventionalCommits": true 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reactizer", 3 | "private": true, 4 | "scripts": { 5 | "prebuild": "rimraf packages/*/lib", 6 | "build": "lerna run build", 7 | "test": "jest --passWithNoTests", 8 | "lint": "eslint 'packages/**/*.{js,ts,tsx}' '*.js'", 9 | "prettier": "prettier --check . || echo \"oops 🙀 pls run 'yarn fmt'\"", 10 | "fmt": "prettier --write .", 11 | "ci": "run-p --print-label test lint prettier ci:workspaces", 12 | "ci:workspaces": "lerna run ci --parallel", 13 | "preversion": "yarn ci", 14 | "prepublishOnly": "yarn build" 15 | }, 16 | "workspaces": { 17 | "packages": [ 18 | "packages/*" 19 | ] 20 | }, 21 | "engines": { 22 | "node": ">=12" 23 | }, 24 | "devDependencies": { 25 | "@babel/cli": "^7.16.8", 26 | "@babel/core": "^7.16.12", 27 | "@commitlint/cli": "^16.1.0", 28 | "@commitlint/config-conventional": "^16.0.0", 29 | "@reactizer/babel-preset": "*", 30 | "@reactizer/eslint-config": "*", 31 | "@typescript-eslint/parser": "^5.10.2", 32 | "cross-env": "^7.0.3", 33 | "eslint": "^8.8.0", 34 | "husky": "^8.0.0", 35 | "jest": "^27.4.7", 36 | "lerna": "^4.0.0", 37 | "npm-run-all": "^4.1.5", 38 | "prettier": "^2.5.1", 39 | "rimraf": "^3.0.2", 40 | "typescript": "^4.5.5" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/babel-preset/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [0.32.2](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.32.1...@reactizer/babel-preset@0.32.2) (2022-01-31) 7 | 8 | **Note:** Version bump only for package @reactizer/babel-preset 9 | 10 | 11 | 12 | 13 | 14 | ## [0.32.1](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.32.0...@reactizer/babel-preset@0.32.1) (2021-06-28) 15 | 16 | **Note:** Version bump only for package @reactizer/babel-preset 17 | 18 | 19 | 20 | 21 | 22 | # [0.32.0](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.31.4...@reactizer/babel-preset@0.32.0) (2021-05-13) 23 | 24 | 25 | ### Features 26 | 27 | * **dev:** upgrade deps ([4ce03d9](https://github.com/oreqizer/reactizer/commit/4ce03d96f7b3b43d84750b3ebef7605ea07240d8)) 28 | 29 | 30 | 31 | 32 | 33 | ## [0.31.4](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.31.3...@reactizer/babel-preset@0.31.4) (2021-03-14) 34 | 35 | **Note:** Version bump only for package @reactizer/babel-preset 36 | 37 | 38 | 39 | 40 | 41 | ## [0.31.3](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.31.2...@reactizer/babel-preset@0.31.3) (2020-11-05) 42 | 43 | **Note:** Version bump only for package @reactizer/babel-preset 44 | 45 | 46 | 47 | 48 | 49 | ## [0.31.2](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.31.1...@reactizer/babel-preset@0.31.2) (2020-11-05) 50 | 51 | 52 | ### Bug Fixes 53 | 54 | * **babel-preset:** cleanup ([7a07dda](https://github.com/oreqizer/reactizer/commit/7a07dda8a18a2ac99eea61080d6ec2e7754fc5fa)) 55 | 56 | 57 | 58 | 59 | 60 | ## [0.31.1](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.31.0...@reactizer/babel-preset@0.31.1) (2020-11-03) 61 | 62 | **Note:** Version bump only for package @reactizer/babel-preset 63 | 64 | 65 | 66 | 67 | 68 | # [0.31.0](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.30.1...@reactizer/babel-preset@0.31.0) (2020-10-31) 69 | 70 | 71 | ### Features 72 | 73 | * **babel-preset:** cleanup plugins and env ([07e41c6](https://github.com/oreqizer/reactizer/commit/07e41c661079f3cdc7c9fe9e09589a242134634f)) 74 | 75 | 76 | 77 | 78 | 79 | ## [0.30.1](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.30.0...@reactizer/babel-preset@0.30.1) (2020-10-31) 80 | 81 | **Note:** Version bump only for package @reactizer/babel-preset 82 | 83 | 84 | 85 | 86 | 87 | # [0.30.0](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.29.0...@reactizer/babel-preset@0.30.0) (2020-10-30) 88 | 89 | 90 | ### Features 91 | 92 | * **eslint-config:** total overhaul ([eb57718](https://github.com/oreqizer/reactizer/commit/eb5771873dc654f0ccaf31c394fdbfa18bc5a0d2)) 93 | 94 | 95 | 96 | 97 | 98 | # [0.29.0](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.28.0...@reactizer/babel-preset@0.29.0) (2020-08-19) 99 | 100 | 101 | ### Features 102 | 103 | * **meta:** big ass cleanup ([75a0487](https://github.com/oreqizer/reactizer/commit/75a0487ef0a281647912a893982ecd380b953b7b)) 104 | 105 | 106 | 107 | 108 | 109 | # [0.28.0](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.27.1...@reactizer/babel-preset@0.28.0) (2020-01-14) 110 | 111 | 112 | ### Features 113 | 114 | * **babel-preset:** dev expression ([11fd890](https://github.com/oreqizer/reactizer/commit/11fd890251329c22cfd66585f2df2073f6bed3f3)) 115 | 116 | 117 | 118 | 119 | 120 | ## [0.27.1](https://github.com/oreqizer/reactizer/compare/@reactizer/babel-preset@0.27.0...@reactizer/babel-preset@0.27.1) (2020-01-13) 121 | 122 | **Note:** Version bump only for package @reactizer/babel-preset 123 | 124 | 125 | 126 | 127 | 128 | # 0.27.0 (2020-01-10) 129 | 130 | 131 | ### Features 132 | 133 | * **meta:** improved structure and build ([f56a442](https://github.com/oreqizer/reactizer/commit/f56a4428bc8cefc72de43655589d11a23be49793)) 134 | 135 | 136 | 137 | 138 | 139 | # [0.26.0](https://github.com/oreqizer/reactizer/compare/v0.25.0...v0.26.0) (2019-12-16) 140 | 141 | **Note:** Version bump only for package @reactizer/babel-preset 142 | 143 | 144 | 145 | 146 | 147 | # [0.25.0](https://github.com/oreqizer/reactizer/compare/v0.24.5...v0.25.0) (2019-12-15) 148 | 149 | 150 | ### Features 151 | 152 | * **theme:** add babel plugin styled components ([f75a3eb](https://github.com/oreqizer/reactizer/commit/f75a3eb9fdd006714a6af04bb640f26956b07ccc)) 153 | 154 | 155 | 156 | 157 | 158 | ## [0.24.5](https://github.com/oreqizer/reactizer/compare/v0.24.4...v0.24.5) (2019-12-15) 159 | 160 | **Note:** Version bump only for package @reactizer/babel-preset 161 | 162 | 163 | 164 | 165 | 166 | ## [0.24.4](https://github.com/oreqizer/reactizer/compare/v0.24.3...v0.24.4) (2019-12-15) 167 | 168 | **Note:** Version bump only for package @reactizer/babel-preset 169 | 170 | 171 | 172 | 173 | 174 | ## [0.24.3](https://github.com/oreqizer/reactizer/compare/v0.24.2...v0.24.3) (2019-12-15) 175 | 176 | **Note:** Version bump only for package @reactizer/babel-preset 177 | 178 | 179 | 180 | 181 | 182 | ## [0.24.1](https://github.com/oreqizer/reactizer/compare/v0.24.0...v0.24.1) (2019-12-15) 183 | 184 | **Note:** Version bump only for package @reactizer/babel-preset 185 | 186 | 187 | 188 | 189 | 190 | # [0.24.0](https://github.com/oreqizer/reactizer/compare/v0.23.0...v0.24.0) (2019-12-15) 191 | 192 | **Note:** Version bump only for package @reactizer/babel-preset 193 | 194 | 195 | 196 | 197 | 198 | # [0.23.0](https://github.com/oreqizer/reactizer/compare/v0.22.0...v0.23.0) (2019-12-14) 199 | 200 | **Note:** Version bump only for package @reactizer/babel-preset 201 | 202 | 203 | 204 | 205 | 206 | # [0.22.0](https://github.com/oreqizer/reactizer/compare/v0.21.4...v0.22.0) (2019-12-12) 207 | 208 | **Note:** Version bump only for package @reactizer/babel-preset 209 | 210 | 211 | 212 | 213 | 214 | ## [0.21.4](https://github.com/oreqizer/reactizer/compare/v0.21.3...v0.21.4) (2019-12-12) 215 | 216 | **Note:** Version bump only for package @reactizer/babel-preset 217 | 218 | 219 | 220 | 221 | 222 | # [0.21.0](https://github.com/oreqizer/reactizer/compare/v0.20.0...v0.21.0) (2019-12-09) 223 | 224 | **Note:** Version bump only for package @reactizer/babel-preset 225 | 226 | 227 | 228 | 229 | 230 | # [0.20.0](https://github.com/oreqizer/reactizer/compare/v0.19.2...v0.20.0) (2019-12-09) 231 | 232 | **Note:** Version bump only for package @reactizer/babel-preset 233 | 234 | 235 | 236 | 237 | 238 | # [0.19.0](https://github.com/oreqizer/reactizer/compare/v0.18.1...v0.19.0) (2019-12-08) 239 | 240 | **Note:** Version bump only for package @reactizer/babel-preset 241 | 242 | 243 | 244 | 245 | 246 | # [0.18.0](https://github.com/oreqizer/reactizer/compare/v0.17.0...v0.18.0) (2019-12-03) 247 | 248 | 249 | ### Bug Fixes 250 | 251 | * **babel-preset:** remove relay ([fd8ca38](https://github.com/oreqizer/reactizer/commit/fd8ca38c8225d9499b4f11bf362ca107cbdcf10c)) 252 | 253 | 254 | 255 | 256 | 257 | # [0.17.0](https://github.com/oreqizer/reactizer/compare/v0.16.1...v0.17.0) (2019-12-03) 258 | 259 | 260 | ### Features 261 | 262 | * **meta:** init babel-preset ([574710a](https://github.com/oreqizer/reactizer/commit/574710ad134ffa631f978a888fbdfc38d0568dcc)) 263 | -------------------------------------------------------------------------------- /packages/babel-preset/README.md: -------------------------------------------------------------------------------- 1 | # @reactizer/babel-preset 2 | 3 | The best Babel preset. 4 | 5 | ## Setup 6 | 7 | `babel.config.js` 8 | 9 | ```js 10 | module.exports = { 11 | presets: ["@reactizer"], 12 | }; 13 | ``` 14 | 15 | **Assumes:** 16 | 17 | - absolute paths relative to the `./src` 18 | 19 | ## License 20 | 21 | MIT 22 | -------------------------------------------------------------------------------- /packages/babel-preset/index.js: -------------------------------------------------------------------------------- 1 | module.exports = (api) => { 2 | api.assertVersion("^7.12"); 3 | 4 | const isWebpack = api.caller((caller) => caller && caller.name === "babel-loader"); 5 | const prod = api.env("production"); 6 | 7 | const env = isWebpack 8 | ? ["@babel/env", { modules: false, targets: { browsers: "> 0.25%, not dead" } }] 9 | : ["@babel/env", { targets: { node: "current" } }]; 10 | 11 | return { 12 | presets: ["@babel/react", "@babel/typescript", env], 13 | plugins: [ 14 | "@babel/transform-runtime", 15 | "@babel/syntax-dynamic-import", 16 | "@babel/proposal-class-properties", 17 | "@babel/proposal-optional-chaining", 18 | "@babel/proposal-nullish-coalescing-operator", 19 | prod && "@babel/transform-react-constant-elements", 20 | "dev-expression", 21 | [ 22 | "module-resolver", 23 | { 24 | root: ["./src"], 25 | extensions: [".js", ".mjs", ".ts", ".tsx"], 26 | }, 27 | ], 28 | ].filter(Boolean), 29 | }; 30 | }; 31 | -------------------------------------------------------------------------------- /packages/babel-preset/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@reactizer/babel-preset", 3 | "version": "0.32.2", 4 | "description": "The best Babel preset.", 5 | "publishConfig": { 6 | "access": "public" 7 | }, 8 | "main": "index.js", 9 | "author": "oreqizer", 10 | "license": "MIT", 11 | "scripts": {}, 12 | "dependencies": { 13 | "@babel/plugin-proposal-class-properties": "^7.16.7", 14 | "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7", 15 | "@babel/plugin-proposal-optional-chaining": "^7.16.7", 16 | "@babel/plugin-syntax-dynamic-import": "^7.8.3", 17 | "@babel/plugin-transform-react-constant-elements": "^7.16.7", 18 | "@babel/plugin-transform-runtime": "^7.16.10", 19 | "@babel/preset-env": "^7.16.11", 20 | "@babel/preset-react": "^7.16.7", 21 | "@babel/preset-typescript": "^7.16.7", 22 | "babel-plugin-dev-expression": "^0.2.3", 23 | "babel-plugin-module-resolver": "^4.1.0" 24 | }, 25 | "peerDependencies": { 26 | "@babel/core": "^7.12.3" 27 | }, 28 | "gitHead": "e112cf5290897641088833ed937f766f7085d1b5" 29 | } 30 | -------------------------------------------------------------------------------- /packages/eslint-config/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [0.35.5](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.35.4...@reactizer/eslint-config@0.35.5) (2022-02-13) 7 | 8 | 9 | ### Bug Fixes 10 | 11 | * **eslint-config:** more proper TS config ([b4ee305](https://github.com/oreqizer/reactizer/commit/b4ee305996161ef6d0f338ed3881b729eb34ef74)) 12 | 13 | 14 | 15 | 16 | 17 | ## [0.35.4](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.35.3...@reactizer/eslint-config@0.35.4) (2022-02-13) 18 | 19 | 20 | ### Bug Fixes 21 | 22 | * **eslint-config:** more proper TS config ([a529cc3](https://github.com/oreqizer/reactizer/commit/a529cc344a29365a244a58ab6b4fe3883ab377a8)) 23 | 24 | 25 | 26 | 27 | 28 | ## [0.35.3](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.35.2...@reactizer/eslint-config@0.35.3) (2022-02-13) 29 | 30 | 31 | ### Bug Fixes 32 | 33 | * **eslint-config:** more proper TS config ([4924145](https://github.com/oreqizer/reactizer/commit/49241459cb59407ffc06f3e696ad83f12f15068c)) 34 | 35 | 36 | 37 | 38 | 39 | ## [0.35.2](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.35.1...@reactizer/eslint-config@0.35.2) (2022-02-13) 40 | 41 | 42 | ### Bug Fixes 43 | 44 | * **eslint-config:** more proper TS config ([6a48da1](https://github.com/oreqizer/reactizer/commit/6a48da163711b8984fa6102bf110969c4930a820)) 45 | 46 | 47 | 48 | 49 | 50 | ## [0.35.1](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.35.0...@reactizer/eslint-config@0.35.1) (2022-02-13) 51 | 52 | 53 | ### Bug Fixes 54 | 55 | * **eslint-config:** proper TS config ([260f534](https://github.com/oreqizer/reactizer/commit/260f5349af7a8d0356ecc4acd49be8101ad82ff1)) 56 | 57 | 58 | 59 | 60 | 61 | # [0.35.0](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.34.2...@reactizer/eslint-config@0.35.0) (2022-02-12) 62 | 63 | 64 | ### Features 65 | 66 | * **eslint-config:** refactor the thang ([50324a2](https://github.com/oreqizer/reactizer/commit/50324a292b5574453d65ba4793ad2fbf5d1427c1)) 67 | 68 | 69 | ### BREAKING CHANGES 70 | 71 | * **eslint-config:** move rules out of index, deps change 72 | 73 | 74 | 75 | 76 | 77 | ## [0.34.2](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.34.1...@reactizer/eslint-config@0.34.2) (2022-01-31) 78 | 79 | **Note:** Version bump only for package @reactizer/eslint-config 80 | 81 | 82 | 83 | 84 | 85 | ## [0.34.1](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.34.0...@reactizer/eslint-config@0.34.1) (2021-06-28) 86 | 87 | **Note:** Version bump only for package @reactizer/eslint-config 88 | 89 | 90 | 91 | 92 | 93 | # [0.34.0](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.33.0...@reactizer/eslint-config@0.34.0) (2021-05-13) 94 | 95 | 96 | ### Features 97 | 98 | * **dev:** upgrade deps ([4ce03d9](https://github.com/oreqizer/reactizer/commit/4ce03d96f7b3b43d84750b3ebef7605ea07240d8)) 99 | 100 | 101 | 102 | 103 | 104 | # [0.33.0](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.32.6...@reactizer/eslint-config@0.33.0) (2021-05-13) 105 | 106 | 107 | ### Features 108 | 109 | * **eslint-config:** deprecated prettier plugin ([90baab9](https://github.com/oreqizer/reactizer/commit/90baab944336c41aeb26de2369e323046ad11752)) 110 | 111 | 112 | 113 | 114 | 115 | ## [0.32.6](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.32.5...@reactizer/eslint-config@0.32.6) (2021-03-15) 116 | 117 | 118 | ### Bug Fixes 119 | 120 | * **eslint-config:** deprecated prettier/ts ([990596f](https://github.com/oreqizer/reactizer/commit/990596fe53dbe614a2a478d0d234366e1230025e)) 121 | 122 | 123 | 124 | 125 | 126 | ## [0.32.5](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.32.4...@reactizer/eslint-config@0.32.5) (2021-03-15) 127 | 128 | 129 | ### Bug Fixes 130 | 131 | * **eslint-config:** deprecated prettier/react ([bfd69b6](https://github.com/oreqizer/reactizer/commit/bfd69b60f97fcb5c025e3d5f1dde23da9e3d6125)) 132 | 133 | 134 | 135 | 136 | 137 | ## [0.32.4](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.32.3...@reactizer/eslint-config@0.32.4) (2021-03-15) 138 | 139 | 140 | ### Bug Fixes 141 | 142 | * **eslint-config:** deprecated prettier/babel ([e5441e2](https://github.com/oreqizer/reactizer/commit/e5441e2cd89ae640f95baf76025ec49b50e9a255)) 143 | 144 | 145 | 146 | 147 | 148 | ## [0.32.3](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.32.2...@reactizer/eslint-config@0.32.3) (2021-03-14) 149 | 150 | **Note:** Version bump only for package @reactizer/eslint-config 151 | 152 | 153 | 154 | 155 | 156 | ## [0.32.2](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.32.1...@reactizer/eslint-config@0.32.2) (2020-11-04) 157 | 158 | 159 | ### Bug Fixes 160 | 161 | * **eslint-config:** remove dupe rule ([ad7603f](https://github.com/oreqizer/reactizer/commit/ad7603fc0495dad91c878e3567d8cfc9cb9698ef)) 162 | 163 | 164 | 165 | 166 | 167 | ## [0.32.1](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.32.0...@reactizer/eslint-config@0.32.1) (2020-11-04) 168 | 169 | 170 | ### Bug Fixes 171 | 172 | * **eslint-config:** remove silly rule ([6210b78](https://github.com/oreqizer/reactizer/commit/6210b78c9ddc720319a4a6f863c6d6fcb69e0591)) 173 | 174 | 175 | 176 | 177 | 178 | # [0.32.0](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.31.0...@reactizer/eslint-config@0.32.0) (2020-11-04) 179 | 180 | 181 | ### Features 182 | 183 | * **eslint-config:** adjust stuffs ([1f113a8](https://github.com/oreqizer/reactizer/commit/1f113a8f6c4ad368e2f6020d02b77ef03d637673)) 184 | 185 | 186 | 187 | 188 | 189 | # [0.31.0](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.30.2...@reactizer/eslint-config@0.31.0) (2020-11-03) 190 | 191 | 192 | ### Features 193 | 194 | * **eslint-config:** adjust stuffs ([964f8cf](https://github.com/oreqizer/reactizer/commit/964f8cf8fc54b30bc4e8043cf52a17a40b5031d1)) 195 | 196 | 197 | 198 | 199 | 200 | ## [0.30.2](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.30.1...@reactizer/eslint-config@0.30.2) (2020-10-31) 201 | 202 | **Note:** Version bump only for package @reactizer/eslint-config 203 | 204 | 205 | 206 | 207 | 208 | ## [0.30.1](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.30.0...@reactizer/eslint-config@0.30.1) (2020-10-31) 209 | 210 | 211 | ### Bug Fixes 212 | 213 | * **eslint-config:** add missing rules ([3502a0a](https://github.com/oreqizer/reactizer/commit/3502a0aa34077f4d53bd122098a159782908b633)) 214 | 215 | 216 | 217 | 218 | 219 | # [0.30.0](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.29.0...@reactizer/eslint-config@0.30.0) (2020-10-30) 220 | 221 | 222 | ### Features 223 | 224 | * **eslint-config:** total overhaul ([eb57718](https://github.com/oreqizer/reactizer/commit/eb5771873dc654f0ccaf31c394fdbfa18bc5a0d2)) 225 | 226 | 227 | 228 | 229 | 230 | # [0.29.0](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.28.0...@reactizer/eslint-config@0.29.0) (2020-08-19) 231 | 232 | 233 | ### Features 234 | 235 | * **meta:** big ass cleanup ([75a0487](https://github.com/oreqizer/reactizer/commit/75a0487ef0a281647912a893982ecd380b953b7b)) 236 | 237 | 238 | 239 | 240 | 241 | # [0.28.0](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.27.1...@reactizer/eslint-config@0.28.0) (2020-01-14) 242 | 243 | 244 | ### Features 245 | 246 | * **eslint-config:** dev expression ([e52b605](https://github.com/oreqizer/reactizer/commit/e52b60581cb0bfb6cb666e793586406de9699681)) 247 | 248 | 249 | 250 | 251 | 252 | ## [0.27.1](https://github.com/oreqizer/reactizer/compare/@reactizer/eslint-config@0.27.0...@reactizer/eslint-config@0.27.1) (2020-01-13) 253 | 254 | **Note:** Version bump only for package @reactizer/eslint-config 255 | 256 | 257 | 258 | 259 | 260 | # 0.27.0 (2020-01-10) 261 | 262 | 263 | ### Features 264 | 265 | * **meta:** improved structure and build ([f56a442](https://github.com/oreqizer/reactizer/commit/f56a4428bc8cefc72de43655589d11a23be49793)) 266 | 267 | 268 | 269 | 270 | 271 | # [0.26.0](https://github.com/oreqizer/reactizer/compare/v0.25.0...v0.26.0) (2019-12-16) 272 | 273 | **Note:** Version bump only for package @reactizer/eslint-config 274 | 275 | 276 | 277 | 278 | 279 | # [0.25.0](https://github.com/oreqizer/reactizer/compare/v0.24.5...v0.25.0) (2019-12-15) 280 | 281 | **Note:** Version bump only for package @reactizer/eslint-config 282 | 283 | 284 | 285 | 286 | 287 | ## [0.24.5](https://github.com/oreqizer/reactizer/compare/v0.24.4...v0.24.5) (2019-12-15) 288 | 289 | **Note:** Version bump only for package @reactizer/eslint-config 290 | 291 | 292 | 293 | 294 | 295 | ## [0.24.4](https://github.com/oreqizer/reactizer/compare/v0.24.3...v0.24.4) (2019-12-15) 296 | 297 | **Note:** Version bump only for package @reactizer/eslint-config 298 | 299 | 300 | 301 | 302 | 303 | ## [0.24.3](https://github.com/oreqizer/reactizer/compare/v0.24.2...v0.24.3) (2019-12-15) 304 | 305 | **Note:** Version bump only for package @reactizer/eslint-config 306 | 307 | 308 | 309 | 310 | 311 | ## [0.24.1](https://github.com/oreqizer/reactizer/compare/v0.24.0...v0.24.1) (2019-12-15) 312 | 313 | **Note:** Version bump only for package @reactizer/eslint-config 314 | 315 | 316 | 317 | 318 | 319 | # [0.24.0](https://github.com/oreqizer/reactizer/compare/v0.23.0...v0.24.0) (2019-12-15) 320 | 321 | **Note:** Version bump only for package @reactizer/eslint-config 322 | 323 | 324 | 325 | 326 | 327 | # [0.23.0](https://github.com/oreqizer/reactizer/compare/v0.22.0...v0.23.0) (2019-12-14) 328 | 329 | **Note:** Version bump only for package @reactizer/eslint-config 330 | 331 | 332 | 333 | 334 | 335 | # [0.22.0](https://github.com/oreqizer/reactizer/compare/v0.21.4...v0.22.0) (2019-12-12) 336 | 337 | **Note:** Version bump only for package @reactizer/eslint-config 338 | 339 | 340 | 341 | 342 | 343 | ## [0.21.4](https://github.com/oreqizer/reactizer/compare/v0.21.3...v0.21.4) (2019-12-12) 344 | 345 | **Note:** Version bump only for package @reactizer/eslint-config 346 | 347 | 348 | 349 | 350 | 351 | # [0.21.0](https://github.com/oreqizer/reactizer/compare/v0.20.0...v0.21.0) (2019-12-09) 352 | 353 | **Note:** Version bump only for package @reactizer/eslint-config 354 | 355 | 356 | 357 | 358 | 359 | # [0.20.0](https://github.com/oreqizer/reactizer/compare/v0.19.2...v0.20.0) (2019-12-09) 360 | 361 | **Note:** Version bump only for package @reactizer/eslint-config 362 | 363 | 364 | 365 | 366 | 367 | ## [0.19.2](https://github.com/oreqizer/reactizer/compare/v0.19.0...v0.19.2) (2019-12-08) 368 | 369 | 370 | ### Bug Fixes 371 | 372 | * **boil-relay:** add relay plugin to eslint ([8ac5871](https://github.com/oreqizer/reactizer/commit/8ac58714626ab1cd57cd11b6daaa54e84ba6910a)) 373 | * **eslint-config:** remove relay plugin ([2323890](https://github.com/oreqizer/reactizer/commit/2323890c5b6792e1741d9b0ca9f39c2a01853356)) 374 | 375 | 376 | 377 | 378 | 379 | ## [0.19.1](https://github.com/oreqizer/reactizer/compare/v0.19.0...v0.19.1) (2019-12-08) 380 | 381 | 382 | ### Bug Fixes 383 | 384 | * **eslint-config:** remove relay plugin ([2323890](https://github.com/oreqizer/reactizer/commit/2323890c5b6792e1741d9b0ca9f39c2a01853356)) 385 | 386 | 387 | 388 | 389 | 390 | # [0.19.0](https://github.com/oreqizer/reactizer/compare/v0.18.1...v0.19.0) (2019-12-08) 391 | 392 | **Note:** Version bump only for package @reactizer/eslint-config 393 | 394 | 395 | 396 | 397 | 398 | ## [0.18.1](https://github.com/oreqizer/reactizer/compare/v0.18.0...v0.18.1) (2019-12-08) 399 | 400 | **Note:** Version bump only for package @reactizer/eslint-config 401 | 402 | 403 | 404 | 405 | 406 | # [0.18.0](https://github.com/oreqizer/reactizer/compare/v0.17.0...v0.18.0) (2019-12-03) 407 | 408 | 409 | ### Features 410 | 411 | * **meta:** add @reactizer/webpack ([7b89939](https://github.com/oreqizer/reactizer/commit/7b8993946072496a4ea437470571aa65eebc5126)) 412 | 413 | 414 | 415 | 416 | 417 | # [0.17.0](https://github.com/oreqizer/reactizer/compare/v0.16.1...v0.17.0) (2019-12-03) 418 | 419 | **Note:** Version bump only for package @reactizer/eslint-config 420 | 421 | 422 | 423 | 424 | 425 | # [0.16.0](https://github.com/oreqizer/reactizer/compare/v0.15.1...v0.16.0) (2019-11-21) 426 | 427 | **Note:** Version bump only for package @reactizer/eslint-config 428 | 429 | 430 | 431 | 432 | 433 | # [0.15.0](https://github.com/oreqizer/reactizer/compare/v0.14.0...v0.15.0) (2019-11-21) 434 | 435 | **Note:** Version bump only for package @reactizer/eslint-config 436 | 437 | 438 | 439 | 440 | 441 | # [0.14.0](https://github.com/oreqizer/reactizer/compare/v0.13.1...v0.14.0) (2019-11-20) 442 | 443 | 444 | ### Features 445 | 446 | * **eslint:** init ([af35a8a](https://github.com/oreqizer/reactizer/commit/af35a8a607f3cc16231b183e23033fb83637c742)) 447 | -------------------------------------------------------------------------------- /packages/eslint-config/README.md: -------------------------------------------------------------------------------- 1 | # @reactizer/eslint-config 2 | 3 | The best ESlint config. 4 | 5 | ## Setup 6 | 7 | `yarn add -D eslint @reactizer/eslint-config @babel/eslint-parser` 8 | 9 | For `@reactizer/eslint-config/ts`: 10 | 11 | - `yarn add -D typescript @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-typescript` 12 | 13 | For `@reactizer/eslint-config/jest`: 14 | 15 | - `yarn add -D eslint-plugin-jest` 16 | 17 | For `@reactizer/eslint-config/react`: 18 | 19 | - `yarn add -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y` 20 | 21 | Make a `.eslintrc.js` file: 22 | 23 | ```js 24 | module.exports = { 25 | extends: [ 26 | "@reactizer", 27 | "@reactizer/eslint-config/react", // if using React 28 | "@reactizer/eslint-config/ts", // if using TypeScript 29 | ], 30 | overrides: [ 31 | // If using Jest 32 | { 33 | files: ["*.spec.js", "*.spec.jsx"], // or .ts, .tsx 34 | extends: ["@reactizer/eslint-config/jest"], 35 | }, 36 | ], 37 | }; 38 | ``` 39 | 40 | Add to `package.json`: 41 | 42 | ```json 43 | { 44 | "scripts": { 45 | "lint": "eslint ." 46 | } 47 | } 48 | ``` 49 | 50 | ## Prettier 51 | 52 | `yarn add prettier` 53 | 54 | Prettier rules to avoid conflicts are included, however, `prettier` itself is not. 55 | 56 | Install `yarn add prettier -D` separately, create `prettier.config.js` and add the 57 | following scripts to `package.json`: 58 | 59 | ```json 60 | { 61 | "scripts": { 62 | "prettier": "prettier --check . || (echo \"oops 🙀 pls run 'yarn fmt'\" && exit 1)", 63 | "fmt": "prettier --write ." 64 | } 65 | } 66 | ``` 67 | 68 | ## Development 69 | 70 | Benchmark: 71 | 72 | - `TIMING=1 eslint ...` 73 | 74 | Checking `prettier` conflicts: 75 | 76 | - `eslint --print-config index.js | eslint-config-prettier-check` 77 | 78 | ## License 79 | 80 | MIT 81 | -------------------------------------------------------------------------------- /packages/eslint-config/index.js: -------------------------------------------------------------------------------- 1 | const OFF = 0; 2 | const WARN = 1; 3 | const ERROR = 2; 4 | 5 | // TODO check Prettier rules if really Prettier 6 | module.exports = { 7 | parser: "@babel/eslint-parser", 8 | extends: ["prettier"], 9 | plugins: [ 10 | "babel", 11 | "eslint-comments", 12 | "fp", 13 | "import", 14 | "node", 15 | ], 16 | parserOptions: { 17 | ecmaVersion: 2021, 18 | sourceType: "module", 19 | }, 20 | env: { 21 | es6: true, 22 | }, 23 | globals: { 24 | __DEV__: true, // Transformed to 'process.env.NODE_ENV !== "production"' 25 | }, 26 | rules: { 27 | // Possible Errors (http://eslint.org/docs/rules/#possible-errors) 28 | "for-direction": ERROR, 29 | "getter-return": ERROR, 30 | "no-async-promise-executor": ERROR, 31 | "no-await-in-loop": ERROR, 32 | "no-compare-neg-zero": ERROR, 33 | "no-cond-assign": ERROR, 34 | "no-console": ERROR, 35 | "no-constant-condition": ERROR, 36 | "no-control-regex": ERROR, 37 | "no-debugger": ERROR, 38 | "no-dupe-args": ERROR, 39 | "no-dupe-else-if": ERROR, 40 | "no-dupe-keys": ERROR, 41 | "no-duplicate-case": ERROR, 42 | "no-empty": [ERROR, { allowEmptyCatch: true }], // Expected errors don't need catch 43 | "no-empty-character-class": ERROR, 44 | "no-ex-assign": ERROR, 45 | "no-extra-boolean-cast": ERROR, 46 | "no-extra-parens": OFF, // Prettier 47 | "no-extra-semi": OFF, // Prettier 48 | "no-func-assign": ERROR, 49 | "no-import-assign": ERROR, 50 | "no-inner-declarations": ERROR, 51 | "no-invalid-regexp": ERROR, 52 | "no-irregular-whitespace": ERROR, 53 | "no-loss-of-precision": ERROR, 54 | "no-misleading-character-class": ERROR, 55 | "no-obj-calls": ERROR, 56 | "no-promise-executor-return": ERROR, 57 | "no-prototype-builtins": ERROR, 58 | "no-regex-spaces": ERROR, 59 | "no-setter-return": ERROR, 60 | "no-sparse-arrays": ERROR, 61 | "no-template-curly-in-string": ERROR, 62 | "no-unexpected-multiline": OFF, // Prettier 63 | "no-unreachable": ERROR, 64 | "no-unreachable-loop": ERROR, 65 | "no-unsafe-finally": ERROR, 66 | "no-unsafe-negation": ERROR, 67 | "no-useless-backreference": ERROR, 68 | "require-atomic-updates": ERROR, 69 | "use-isnan": ERROR, 70 | "valid-typeof": ERROR, 71 | 72 | // Best Practices (http://eslint.org/docs/rules/#best-practices) 73 | "accessor-pairs": ERROR, 74 | "array-callback-return": ERROR, 75 | "block-scoped-var": ERROR, 76 | "class-methods-use-this": ERROR, 77 | complexity: OFF, // Too extra 78 | "consistent-return": ERROR, 79 | curly: ERROR, 80 | "default-case": ERROR, 81 | "default-case-last": ERROR, 82 | "default-param-last": ERROR, 83 | "dot-location": OFF, // Prettier 84 | "dot-notation": ERROR, 85 | eqeqeq: ERROR, 86 | "grouped-accessor-pairs": ERROR, 87 | "guard-for-in": ERROR, 88 | "max-classes-per-file": ERROR, 89 | "no-alert": ERROR, 90 | "no-caller": ERROR, 91 | "no-case-declarations": ERROR, 92 | "no-constructor-return": ERROR, 93 | "no-div-regex": ERROR, 94 | "no-else-return": ERROR, 95 | "no-empty-function": OFF, // Sentinel functions in default contexts 96 | "no-empty-pattern": ERROR, 97 | "no-eq-null": ERROR, 98 | "no-eval": ERROR, 99 | "no-extend-native": ERROR, 100 | "no-extra-bind": ERROR, 101 | "no-extra-label": ERROR, 102 | "no-fallthrough": ERROR, 103 | "no-floating-decimal": OFF, // Prettier 104 | "no-global-assign": ERROR, 105 | "no-implicit-coercion": ERROR, 106 | "no-implicit-globals": ERROR, 107 | "no-implied-eval": ERROR, 108 | "no-invalid-this": OFF, // See babel/no-invalid-this 109 | "no-iterator": ERROR, 110 | "no-labels": ERROR, 111 | "no-lone-blocks": ERROR, 112 | "no-loop-func": ERROR, 113 | "no-magic-numbers": OFF, // Just too annoying to enforce 114 | "no-multi-spaces": OFF, // Prettier 115 | "no-multi-str": ERROR, 116 | "no-new": ERROR, 117 | "no-new-func": ERROR, 118 | "no-new-wrappers": ERROR, 119 | "no-octal": ERROR, 120 | "no-octal-escape": ERROR, 121 | "no-param-reassign": ERROR, 122 | "no-proto": ERROR, 123 | "no-redeclare": ERROR, 124 | "no-restricted-properties": OFF, // None come to mind 125 | "no-return-assign": ERROR, 126 | "no-return-await": ERROR, 127 | "no-script-url": ERROR, 128 | "no-self-assign": ERROR, 129 | "no-self-compare": ERROR, 130 | "no-sequences": ERROR, 131 | "no-throw-literal": ERROR, 132 | "no-unmodified-loop-condition": ERROR, 133 | "no-unused-expressions": ERROR, 134 | "no-unused-labels": ERROR, 135 | "no-useless-call": ERROR, 136 | "no-useless-catch": ERROR, 137 | "no-useless-concat": ERROR, 138 | "no-useless-escape": ERROR, 139 | "no-useless-return": ERROR, 140 | "no-void": ERROR, 141 | "no-warning-comments": WARN, // Enough to be annoying 142 | "no-with": ERROR, 143 | "prefer-named-capture-group": WARN, // Maybe error later, people don't know about this yet 144 | "prefer-promise-reject-errors": ERROR, 145 | "prefer-regex-literals": ERROR, 146 | radix: ERROR, 147 | "require-await": ERROR, 148 | "require-unicode-regexp": OFF, // Nah 149 | "vars-on-top": ERROR, 150 | "wrap-iife": OFF, // Prettier 151 | yoda: ERROR, 152 | 153 | // Strict Mode (http://eslint.org/docs/rules/#strict-mode) 154 | strict: WARN, // Enough 155 | 156 | // Variables (http://eslint.org/docs/rules/#variables) 157 | "init-declarations": ERROR, 158 | "no-delete-var": ERROR, 159 | "no-label-var": ERROR, 160 | "no-restricted-globals": ERROR, 161 | "no-shadow-restricted-names": ERROR, 162 | "no-shadow": ERROR, 163 | "no-undef-init": ERROR, 164 | "no-undef": ERROR, 165 | "no-undefined": ERROR, 166 | "no-unused-vars": ERROR, 167 | "no-use-before-define": ERROR, 168 | 169 | // Stylistic Issues (http://eslint.org/docs/rules/#stylistic-issues) 170 | // Some are skipped if taken care of by Prettier 171 | camelcase: OFF, // See babel/camelcase 172 | "capitalized-comments": OFF, // Too subjective 173 | "consistent-this": OFF, // Obsolete 174 | "func-name-matching": OFF, // Obsolete 175 | "func-names": ERROR, 176 | "func-style": [ERROR, "declaration", { allowArrowFunctions: true }], 177 | "id-denylist": OFF, // Not needed 178 | "id-length": OFF, // Too extra 179 | "id-match": OFF, // Not needed 180 | "lines-between-class-members": [ERROR, "always", { exceptAfterSingleLine: true }], 181 | "max-depth": OFF, // Too extra 182 | "max-lines": OFF, // Too extra 183 | "max-lines-per-function": OFF, // Too extra 184 | "max-nested-callbacks": OFF, // Obsolete 185 | "max-params": OFF, // Too extra 186 | "max-statements": OFF, // Too extra 187 | "max-statements-per-line": ERROR, 188 | "multiline-comment-style": [ERROR, "separate-lines"], 189 | "new-cap": ERROR, 190 | "no-array-constructor": ERROR, 191 | "no-bitwise": ERROR, 192 | "no-continue": ERROR, 193 | "no-inline-comments": OFF, // They make sense 194 | "no-lonely-if": ERROR, 195 | "no-multi-assign": ERROR, 196 | "no-negated-condition": ERROR, 197 | "no-nested-ternary": ERROR, 198 | "no-new-object": ERROR, 199 | "no-plusplus": ERROR, 200 | "no-restricted-syntax": OFF, // Not needed 201 | "no-ternary": OFF, // Ternaries are good 202 | "no-underscore-dangle": [ERROR, { allow: ["__DEV__"] }], 203 | "no-unneeded-ternary": ERROR, 204 | "one-var": [ERROR, "never"], 205 | "operator-assignment": ERROR, 206 | "padding-line-between-statements": OFF, // Too subjective 207 | "prefer-object-spread": ERROR, 208 | "require-jsdoc": OFF, // Obsolete 209 | "sort-keys": OFF, // Too extra 210 | "sort-vars": OFF, // Too extra 211 | "spaced-comment": ERROR, 212 | 213 | // ECMAScript 6 (http://eslint.org/docs/rules/#ecmascript-6) 214 | "constructor-super": ERROR, 215 | "no-class-assign": ERROR, 216 | "no-const-assign": ERROR, 217 | "no-dupe-class-members": ERROR, 218 | "no-duplicate-imports": ERROR, 219 | "no-new-symbol": ERROR, 220 | "no-restricted-imports": OFF, // None yet 221 | "no-this-before-super": ERROR, 222 | "no-useless-computed-key": ERROR, 223 | "no-useless-constructor": ERROR, 224 | "no-var": ERROR, 225 | "no-useless-rename": ERROR, 226 | "object-shorthand": ERROR, 227 | "prefer-const": [ERROR, { destructuring: "all" }], 228 | "prefer-destructuring": ERROR, 229 | "prefer-numeric-literals": ERROR, 230 | "prefer-rest-params": ERROR, 231 | "prefer-spread": ERROR, 232 | "prefer-template": ERROR, 233 | "require-yield": ERROR, 234 | "sort-imports": OFF, // Too extra 235 | "symbol-description": ERROR, 236 | 237 | // Babel (https://github.com/babel/eslint-plugin-babel) 238 | "babel/camelcase": ERROR, 239 | "babel/new-cap": ERROR, 240 | "babel/no-invalid-this": ERROR, 241 | "babel/no-unused-expressions": ERROR, 242 | "babel/valid-typeof": ERROR, 243 | 244 | // import (https://github.com/benmosher/eslint-plugin-import) 245 | "import/default": OFF, // Too extra 246 | "import/dynamic-import-chunkname": OFF, // Not needed 247 | "import/export": ERROR, 248 | "import/exports-last": OFF, // Too extra 249 | "import/extensions": [ERROR, "never", { json: "always" }], 250 | "import/first": ERROR, 251 | "import/group-exports": OFF, // Too extra 252 | "import/named": ERROR, 253 | "import/namespace": ERROR, 254 | "import/newline-after-import": ERROR, 255 | "import/no-absolute-path": ERROR, 256 | "import/no-amd": ERROR, 257 | "import/no-anonymous-default-export": ERROR, 258 | "import/no-commonjs": OFF, // Legacy 259 | "import/no-cycle": OFF, // A very slow rule, use 'madge' instead 260 | "import/no-default-export": OFF, // Silly 261 | "import/no-deprecated": OFF, // Too slow 262 | "import/no-duplicates": ERROR, 263 | "import/no-dynamic-require": ERROR, 264 | "import/no-extraneous-dependencies": [ 265 | ERROR, 266 | { 267 | devDependencies: ["gulpfile.js", "webpack.config.js", "etc/**", "stories/**", "**/*.spec.*"], 268 | }, 269 | ], 270 | "import/no-internal-modules": OFF, // Silly 271 | "import/no-mutable-exports": ERROR, 272 | "import/no-namespace": OFF, // Too extra 273 | "import/no-named-as-default": ERROR, 274 | "import/no-named-as-default-member": ERROR, 275 | "import/no-named-default": ERROR, 276 | "import/no-named-export": OFF, // Silly 277 | "import/no-nodejs-modules": OFF, // Silly 278 | "import/no-relative-parent-imports": OFF, // Too extra 279 | "import/no-restricted-paths": OFF, // Not needed 280 | "import/no-unassigned-import": OFF, // Silly 281 | "import/no-unresolved": ERROR, 282 | "import/no-useless-path-segments": OFF, // Too slow 283 | "import/no-webpack-loader-syntax": ERROR, 284 | "import/max-dependencies": OFF, // Too extra 285 | "import/order": [ 286 | ERROR, 287 | { 288 | groups: [["builtin", "external"], ["parent", "sibling"], "index"], 289 | "newlines-between": "always", 290 | }, 291 | ], 292 | "import/prefer-default-export": OFF, // Silly 293 | "import/no-self-import": ERROR, 294 | "import/no-unused-modules": ERROR, 295 | "import/unambiguous": OFF, // Too extra 296 | 297 | // Node.js (https://github.com/mysticatea/eslint-plugin-node) 298 | "node/exports-style": OFF, // ES6 299 | "node/file-extension-in-import": OFF, // Broken rule 300 | "node/handle-callback-err": OFF, // Too extra 301 | "node/no-callback-literal": ERROR, 302 | "node/no-deprecated-api": ERROR, 303 | "node/no-exports-assign": ERROR, 304 | "node/no-extraneous-import": OFF, // Handled by 'import' 305 | "node/no-extraneous-require": OFF, // Handled by 'import' 306 | "node/no-missing-import": OFF, // Handled by 'import' 307 | "node/no-missing-require": ERROR, 308 | "node/no-unpublished-bin": ERROR, 309 | "node/no-unpublished-import": OFF, // Handled by 'import 310 | "node/no-unpublished-require": OFF, // Handled by 'import 311 | "node/no-unsupported-features/es-builtins": OFF, // Babel 312 | "node/no-unsupported-features/es-syntax": OFF, // Babel 313 | "node/no-unsupported-features/node-builtins": OFF, // Babel 314 | "node/prefer-global/buffer": ERROR, 315 | "node/prefer-global/console": ERROR, 316 | "node/prefer-global/process": ERROR, 317 | "node/prefer-global/text-decoder": ERROR, 318 | "node/prefer-global/text-encoder": ERROR, 319 | "node/prefer-global/url": ERROR, 320 | "node/prefer-global/url-search-params": ERROR, 321 | "node/prefer-promises/dns": ERROR, 322 | "node/prefer-promises/fs": ERROR, 323 | "node/process-exit-as-throw": ERROR, 324 | "node/shebang": ERROR, 325 | 326 | // Eslint comments (https://github.com/mysticatea/eslint-plugin-eslint-comments) 327 | "eslint-comments/disable-enable-pair": [ERROR, { allowWholeFile: true }], 328 | "eslint-comments/no-aggregating-enable": ERROR, 329 | "eslint-comments/no-duplicate-disable": ERROR, 330 | "eslint-comments/no-restricted-disable": OFF, // Not yet needed 331 | "eslint-comments/no-unlimited-disable": OFF, // Not yet needed 332 | "eslint-comments/no-unused-disable": ERROR, 333 | "eslint-comments/no-unused-enable": ERROR, 334 | "eslint-comments/no-use": OFF, // Silly 335 | 336 | // FP (https://github.com/jfmengels/eslint-plugin-fp) 337 | "fp/no-arguments": ERROR, 338 | "fp/no-class": ERROR, 339 | "fp/no-delete": ERROR, 340 | "fp/no-events": ERROR, 341 | "fp/no-get-set": ERROR, 342 | "fp/no-let": ERROR, 343 | "fp/no-loops": ERROR, 344 | "fp/no-mutating-assign": ERROR, 345 | "fp/no-mutating-methods": ERROR, 346 | "fp/no-mutation": [ 347 | ERROR, 348 | { 349 | commonjs: true, 350 | exceptions: [{ property: "defaultProps" }, { property: "displayName" }], 351 | }, 352 | ], 353 | "fp/no-nil": OFF, // Nulls are legit 354 | "fp/no-proxy": ERROR, 355 | "fp/no-rest-parameters": ERROR, 356 | "fp/no-this": ERROR, 357 | "fp/no-throw": ERROR, 358 | "fp/no-unused-expression": OFF, // 'fs' calls, tests 359 | "fp/no-valueof-field": ERROR, 360 | 361 | // TODO go through these: 362 | "arrow-body-style": OFF, 363 | "eslint-comments/require-description": OFF, 364 | "import/no-import-module-exports": OFF, 365 | "import/no-relative-packages": OFF, 366 | "line-comment-position": OFF, 367 | "no-nonoctal-decimal-escape": OFF, 368 | "no-restricted-exports": OFF, 369 | "no-unsafe-optional-chaining": OFF, 370 | "no-unused-private-class-members": OFF, 371 | "node/callback-return": OFF, 372 | "node/global-require": OFF, 373 | "node/no-mixed-requires": OFF, 374 | "node/no-new-require": OFF, 375 | "node/no-path-concat": OFF, 376 | "node/no-process-env": OFF, 377 | "node/no-process-exit": OFF, 378 | "node/no-restricted-import": OFF, 379 | "node/no-restricted-require": OFF, 380 | "node/no-sync": OFF, 381 | "prefer-arrow-callback": OFF, 382 | "prefer-exponentiation-operator": OFF, 383 | "prefer-object-has-own": OFF, 384 | }, 385 | }; 386 | -------------------------------------------------------------------------------- /packages/eslint-config/jest.js: -------------------------------------------------------------------------------- 1 | const OFF = 0; 2 | const WARN = 1; 3 | const ERROR = 2; 4 | 5 | module.exports = { 6 | plugins: ["jest"], 7 | env: { 8 | jest: true, 9 | }, 10 | settings: { 11 | jest: { 12 | version: "detect", 13 | }, 14 | }, 15 | rules: { 16 | // Jest (https://github.com/jest-community/eslint-plugin-jest) 17 | "jest/consistent-test-it": [ERROR, { fn: "test" }], 18 | "jest/expect-expect": OFF, // Too extra 19 | "jest/max-nested-describe": ERROR, 20 | "jest/no-alias-methods": ERROR, 21 | "jest/no-commented-out-tests": WARN, // Not that bad for an error 22 | "jest/no-conditional-expect": ERROR, 23 | "jest/no-deprecated-functions": ERROR, 24 | "jest/no-disabled-tests": ERROR, 25 | "jest/no-done-callback": ERROR, 26 | "jest/no-duplicate-hooks": ERROR, 27 | "jest/no-export": ERROR, 28 | "jest/no-focused-tests": ERROR, 29 | "jest/no-hooks": OFF, // OK in some cases 30 | "jest/no-identical-title": ERROR, 31 | "jest/no-if": ERROR, 32 | "jest/no-interpolation-in-snapshots": ERROR, 33 | "jest/no-jasmine-globals": ERROR, 34 | "jest/no-jest-import": ERROR, 35 | "jest/no-large-snapshots": ERROR, 36 | "jest/no-mocks-import": ERROR, 37 | "jest/no-restricted-matchers": ERROR, 38 | "jest/no-standalone-expect": ERROR, 39 | "jest/no-test-prefixes": ERROR, 40 | "jest/no-test-return-statement": ERROR, 41 | "jest/prefer-called-with": ERROR, 42 | "jest/prefer-comparison-matcher": ERROR, 43 | "jest/prefer-equality-matcher": ERROR, 44 | "jest/prefer-expect-assertions": ERROR, 45 | "jest/prefer-expect-resolves": ERROR, 46 | "jest/prefer-hooks-on-top": ERROR, 47 | "jest/prefer-lowercase-title": ERROR, 48 | "jest/prefer-spy-on": WARN, // Nice-to-have, but not critical 49 | "jest/prefer-strict-equal": ERROR, 50 | "jest/prefer-to-be": ERROR, 51 | "jest/prefer-to-contain": ERROR, 52 | "jest/prefer-to-have-length": ERROR, 53 | "jest/prefer-todo": ERROR, 54 | "jest/require-hook": ERROR, 55 | "jest/require-to-throw-message": ERROR, 56 | "jest/require-top-level-describe": ERROR, 57 | "jest/unbound-method": ERROR, 58 | "jest/valid-describe-callback": ERROR, 59 | "jest/valid-expect": ERROR, 60 | "jest/valid-expect-in-promise": ERROR, 61 | "jest/valid-title": ERROR, 62 | }, 63 | }; 64 | -------------------------------------------------------------------------------- /packages/eslint-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@reactizer/eslint-config", 3 | "version": "0.35.5", 4 | "description": "The best ESlint config.", 5 | "publishConfig": { 6 | "access": "public" 7 | }, 8 | "main": "index.js", 9 | "author": "oreqizer", 10 | "license": "MIT", 11 | "scripts": { 12 | "ci": "run-p --print-label ci:*", 13 | "ci:index-find": "eslint-find-rules --unused index.js", 14 | "ci:index-prettier": "eslint-config-prettier index.js", 15 | "ci:jest-find": "eslint-find-rules --unused jest.js --no-core", 16 | "ci:jest-prettier": "eslint-config-prettier jest.js", 17 | "ci:react-find": "eslint-find-rules --unused react.js --no-core", 18 | "ci:react-prettier": "eslint-config-prettier react.js", 19 | "ci:ts-find": "eslint-find-rules --unused ts.js --no-core", 20 | "ci:ts-prettier": "eslint-config-prettier ts.js" 21 | }, 22 | "dependencies": { 23 | "eslint-config-prettier": "^8.3.0", 24 | "eslint-plugin-babel": "^5.3.1", 25 | "eslint-plugin-eslint-comments": "^3.2.0", 26 | "eslint-plugin-fp": "^2.3.0", 27 | "eslint-plugin-import": "^2.25.4", 28 | "eslint-plugin-node": "^11.1.0" 29 | }, 30 | "peerDependencies": { 31 | "@babel/eslint-parser": "^7.17.0", 32 | "@typescript-eslint/eslint-plugin": "^5.10.2", 33 | "@typescript-eslint/parser": "^5.10.2", 34 | "eslint": "^8.0.0", 35 | "eslint-import-resolver-typescript": "^2.5.0", 36 | "eslint-plugin-jest": "^26.0.0", 37 | "eslint-plugin-jsx-a11y": "^6.5.1", 38 | "eslint-plugin-react": "^7.28.0", 39 | "eslint-plugin-react-hooks": "^4.3.0", 40 | "typescript": "^4.0.5" 41 | }, 42 | "peerDependenciesMeta": { 43 | "@typescript-eslint/eslint-plugin": { 44 | "optional": true 45 | }, 46 | "@typescript-eslint/parser": { 47 | "optional": true 48 | }, 49 | "eslint-import-resolver-typescript": { 50 | "optional": true 51 | }, 52 | "eslint-plugin-jest": { 53 | "optional": true 54 | }, 55 | "eslint-plugin-jsx-a11y": { 56 | "optional": true 57 | }, 58 | "eslint-plugin-react": { 59 | "optional": true 60 | }, 61 | "eslint-plugin-react-hooks": { 62 | "optional": true 63 | }, 64 | "typescript": { 65 | "optional": true 66 | } 67 | }, 68 | "devDependencies": { 69 | "eslint-find-rules": "^4.1.0" 70 | }, 71 | "gitHead": "e112cf5290897641088833ed937f766f7085d1b5" 72 | } 73 | -------------------------------------------------------------------------------- /packages/eslint-config/react.js: -------------------------------------------------------------------------------- 1 | const OFF = 0; 2 | const WARN = 1; 3 | const ERROR = 2; 4 | 5 | // TODO check Prettier rules if really Prettier 6 | module.exports = { 7 | plugins: ["jsx-a11y", "react", "react-hooks"], 8 | settings: { 9 | react: { 10 | version: "detect", 11 | }, 12 | }, 13 | rules: { 14 | // React (https://github.com/yannickcr/eslint-plugin-react) 15 | "react/boolean-prop-naming": ERROR, 16 | "react/button-has-type": [ERROR, { button: true, submit: true, reset: false }], 17 | "react/default-props-match-prop-types": ERROR, 18 | "react/destructuring-assignment": ERROR, 19 | "react/display-name": ERROR, 20 | "react/forbid-component-props": OFF, // Too extra 21 | "react/forbid-dom-props": [ 22 | ERROR, 23 | { 24 | forbid: [ 25 | "class", // https://reactjs.org/docs/dom-elements.html#classname 26 | "for", // https://reactjs.org/docs/dom-elements.html#htmlfor 27 | ], 28 | }, 29 | ], 30 | "react/forbid-elements": OFF, // Too extra 31 | "react/forbid-foreign-prop-types": OFF, // Not using 'propTypes' 32 | "react/forbid-prop-types": OFF, // Too extra 33 | "react/function-component-definition": [ 34 | ERROR, 35 | { 36 | namedComponents: "arrow-function", 37 | unnamedComponents: "arrow-function", 38 | }, 39 | ], 40 | "react/no-access-state-in-setstate": ERROR, 41 | "react/no-adjacent-inline-elements": OFF, // Prettier 42 | "react/no-array-index-key": ERROR, 43 | "react/no-arrow-function-lifecycle": ERROR, 44 | "react/no-children-prop": ERROR, 45 | "react/no-danger": ERROR, 46 | "react/no-danger-with-children": ERROR, 47 | "react/no-deprecated": ERROR, 48 | "react/no-did-mount-set-state": ERROR, 49 | "react/no-did-update-set-state": ERROR, 50 | "react/no-direct-mutation-state": ERROR, 51 | "react/no-find-dom-node": ERROR, 52 | "react/no-invalid-html-attribute": ERROR, 53 | "react/no-namespace": ERROR, 54 | "react/no-is-mounted": ERROR, 55 | "react/no-multi-comp": [ERROR, { ignoreStateless: true }], 56 | "react/no-redundant-should-component-update": ERROR, 57 | "react/no-render-return-value": ERROR, 58 | "react/no-set-state": OFF, // 'setState' is OK 59 | "react/no-string-refs": ERROR, 60 | "react/no-this-in-sfc": ERROR, 61 | "react/no-typos": ERROR, 62 | "react/no-unescaped-entities": ERROR, 63 | "react/no-unknown-property": ERROR, 64 | "react/no-unsafe": ERROR, 65 | "react/no-unstable-nested-components": ERROR, 66 | "react/no-unused-class-component-methods": ERROR, 67 | "react/no-unused-prop-types": ERROR, 68 | "react/no-unused-state": ERROR, 69 | "react/no-will-update-set-state": ERROR, 70 | "react/prefer-es6-class": [ERROR, "always"], 71 | "react/prefer-exact-props": ERROR, 72 | "react/prefer-read-only-props": OFF, // Too extra 73 | "react/prefer-stateless-function": ERROR, 74 | "react/prop-types": ERROR, 75 | "react/react-in-jsx-scope": OFF, // Obsolete rule 76 | "react/require-default-props": OFF, // Too extra, sometimes invalid 77 | "react/require-optimization": OFF, // Too extra, sometimes invalid 78 | "react/require-render-return": ERROR, 79 | "react/self-closing-comp": ERROR, 80 | "react/sort-comp": [ 81 | ERROR, 82 | { 83 | // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md 84 | order: [ 85 | "type-annotations", 86 | "static-variables", 87 | "static-methods", 88 | "instance-variables", 89 | "lifecycle", 90 | "everything-else", 91 | "rendering", 92 | ], 93 | groups: { 94 | lifecycle: [ 95 | "displayName", 96 | "propTypes", 97 | "contextTypes", 98 | "childContextTypes", 99 | "mixins", 100 | "statics", 101 | "defaultProps", 102 | "constructor", 103 | "getDefaultProps", 104 | "state", 105 | "getInitialState", 106 | "getChildContext", 107 | "getDerivedStateFromProps", // This is added 108 | "getDerivedStateFromError", // This is added 109 | "componentWillMount", 110 | "UNSAFE_componentWillMount", 111 | "componentDidMount", 112 | "componentWillReceiveProps", 113 | "UNSAFE_componentWillReceiveProps", 114 | "shouldComponentUpdate", 115 | "componentWillUpdate", 116 | "UNSAFE_componentWillUpdate", 117 | "getSnapshotBeforeUpdate", 118 | "componentDidUpdate", 119 | "componentDidCatch", 120 | "componentWillUnmount", 121 | ], 122 | rendering: ["/^render.+$/", "render"], 123 | }, 124 | }, 125 | ], 126 | "react/sort-prop-types": OFF, // Too extra 127 | "react/state-in-constructor": ERROR, 128 | "react/static-property-placement": ERROR, 129 | "react/style-prop-object": ERROR, 130 | "react/void-dom-elements-no-children": ERROR, 131 | 132 | // React JSX (https://github.com/yannickcr/eslint-plugin-react#jsx-specific-rules) 133 | // Some are skipped if taken care of by Prettier 134 | "react/jsx-boolean-value": ERROR, 135 | "react/jsx-child-element-spacing": OFF, // Prettier 136 | "react/jsx-closing-bracket-location": OFF, // Prettier 137 | "react/jsx-closing-tag-location": OFF, // Prettier 138 | "react/jsx-curly-brace-presence": ERROR, 139 | "react/jsx-curly-newline": OFF, // Prettier 140 | "react/jsx-curly-spacing": OFF, // Prettier 141 | "react/jsx-equals-spacing": OFF, // Prettier 142 | "react/jsx-filename-extension": [ERROR, { extensions: [".tsx", ".jsx"] }], 143 | "react/jsx-first-prop-new-line": OFF, // Prettier 144 | "react/jsx-fragments": ERROR, 145 | "react/jsx-handler-names": ERROR, 146 | "react/jsx-indent": OFF, // Prettier 147 | "react/jsx-indent-props": OFF, // Prettier 148 | "react/jsx-key": ERROR, 149 | "react/jsx-max-depth": OFF, // Too extra 150 | "react/jsx-max-props-per-line": OFF, // Prettier 151 | "react/jsx-newline": OFF, // Prettier 152 | "react/jsx-no-bind": [ 153 | ERROR, 154 | { 155 | ignoreDOMComponents: true, 156 | ignoreRefs: true, 157 | }, 158 | ], 159 | "react/jsx-no-constructed-context-values": OFF, // Prettier 160 | "react/jsx-no-comment-textnodes": ERROR, 161 | "react/jsx-no-duplicate-props": ERROR, 162 | "react/jsx-no-literals": OFF, // No need 163 | "react/jsx-no-target-blank": ERROR, 164 | "react/jsx-no-script-url": OFF, // Prettier 165 | "react/jsx-no-undef": ERROR, 166 | "react/jsx-no-useless-fragment": ERROR, 167 | "react/jsx-one-expression-per-line": OFF, // Prettier 168 | "react/jsx-pascal-case": ERROR, 169 | "react/jsx-props-no-multi-spaces": OFF, // Prettier 170 | "react/jsx-props-no-spreading": OFF, // It is OK 171 | "react/jsx-sort-default-props": OFF, // Too extra 172 | "react/jsx-sort-props": OFF, // Too extra 173 | "react/jsx-tag-spacing": OFF, // Prettier 174 | "react/jsx-uses-react": ERROR, 175 | "react/jsx-uses-vars": ERROR, 176 | "react/jsx-wrap-multilines": OFF, // Prettier 177 | 178 | // React Hooks (https://www.npmjs.com/package/eslint-plugin-react-hooks) 179 | "react-hooks/rules-of-hooks": ERROR, 180 | "react-hooks/exhaustive-deps": WARN, // Sometimes intended 181 | 182 | // React Accessibility (https://github.com/evcohen/eslint-plugin-jsx-a11y) 183 | "jsx-a11y/accessible-emoji": ERROR, 184 | "jsx-a11y/alt-text": ERROR, 185 | "jsx-a11y/anchor-has-content": ERROR, 186 | "jsx-a11y/anchor-is-valid": ERROR, 187 | "jsx-a11y/aria-activedescendant-has-tabindex": ERROR, 188 | "jsx-a11y/aria-props": ERROR, 189 | "jsx-a11y/aria-proptypes": ERROR, 190 | "jsx-a11y/aria-role": ERROR, 191 | "jsx-a11y/aria-unsupported-elements": ERROR, 192 | "jsx-a11y/autocomplete-valid": ERROR, 193 | "jsx-a11y/click-events-have-key-events": ERROR, 194 | "jsx-a11y/control-has-associated-label": ERROR, 195 | "jsx-a11y/heading-has-content": ERROR, 196 | "jsx-a11y/html-has-lang": ERROR, 197 | "jsx-a11y/iframe-has-title": ERROR, 198 | "jsx-a11y/img-redundant-alt": ERROR, 199 | "jsx-a11y/interactive-supports-focus": ERROR, 200 | "jsx-a11y/label-has-associated-control": ERROR, 201 | "jsx-a11y/label-has-for": ERROR, 202 | "jsx-a11y/lang": ERROR, 203 | "jsx-a11y/media-has-caption": ERROR, 204 | "jsx-a11y/mouse-events-have-key-events": ERROR, 205 | "jsx-a11y/no-access-key": ERROR, 206 | "jsx-a11y/no-autofocus": [ERROR, { ignoreNonDOM: true }], 207 | "jsx-a11y/no-distracting-elements": [ERROR, { elements: ["marquee", "blink"] }], 208 | "jsx-a11y/no-interactive-element-to-noninteractive-role": ERROR, 209 | "jsx-a11y/no-noninteractive-element-interactions": ERROR, 210 | "jsx-a11y/no-noninteractive-element-to-interactive-role": ERROR, 211 | "jsx-a11y/no-noninteractive-tabindex": ERROR, 212 | "jsx-a11y/no-onchange": ERROR, 213 | "jsx-a11y/no-redundant-roles": ERROR, 214 | "jsx-a11y/no-static-element-interactions": ERROR, 215 | "jsx-a11y/role-has-required-aria-props": ERROR, 216 | "jsx-a11y/role-supports-aria-props": ERROR, 217 | "jsx-a11y/scope": ERROR, 218 | "jsx-a11y/tabindex-no-positive": ERROR, 219 | }, 220 | }; 221 | -------------------------------------------------------------------------------- /packages/eslint-config/ts.js: -------------------------------------------------------------------------------- 1 | const OFF = 0; 2 | const WARN = 1; 3 | const ERROR = 2; 4 | 5 | // TODO check Prettier rules if really Prettier 6 | module.exports = { 7 | settings: { 8 | "import/parsers": { 9 | "@typescript-eslint/parser": [".ts", ".tsx"], 10 | }, 11 | "import/resolver": { 12 | node: { 13 | extensions: [".js", ".jsx", ".ts", ".tsx"], 14 | }, 15 | typescript: { 16 | alwaysTryTypes: true, 17 | project: "./tsconfig.json", 18 | }, 19 | }, 20 | }, 21 | overrides: [ 22 | { 23 | files: ["*.ts", "*.tsx"], 24 | parser: "@typescript-eslint/parser", 25 | plugins: ["@typescript-eslint"], 26 | parserOptions: { 27 | project: "./tsconfig.json", 28 | }, 29 | rules: { 30 | // TypeScript (https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin) 31 | "@typescript-eslint/adjacent-overload-signatures": ERROR, 32 | "@typescript-eslint/array-type": ERROR, 33 | "@typescript-eslint/await-thenable": ERROR, 34 | "@typescript-eslint/ban-tslint-comment": ERROR, 35 | "@typescript-eslint/ban-ts-comment": [ERROR, { "ts-expect-error": "allow-with-description" }], 36 | "@typescript-eslint/ban-types": ERROR, 37 | "@typescript-eslint/class-literal-property-style": OFF, // Too extra 38 | "@typescript-eslint/consistent-indexed-object-style": ERROR, 39 | "@typescript-eslint/consistent-type-assertions": ERROR, 40 | "@typescript-eslint/consistent-type-definitions": [ERROR, "type"], 41 | "@typescript-eslint/consistent-type-imports": ERROR, 42 | "@typescript-eslint/explicit-function-return-type": OFF, // Too extra 43 | "@typescript-eslint/explicit-module-boundary-types": OFF, // Too extra 44 | "@typescript-eslint/explicit-member-accessibility": OFF, // Too extra 45 | "@typescript-eslint/member-delimiter-style": OFF, // Prettier 46 | "@typescript-eslint/member-ordering": ERROR, 47 | "@typescript-eslint/naming-convention": OFF, // Too extra 48 | "@typescript-eslint/no-base-to-string": ERROR, 49 | "@typescript-eslint/no-confusing-non-null-assertion": ERROR, 50 | "@typescript-eslint/no-dynamic-delete": ERROR, 51 | "@typescript-eslint/no-empty-interface": ERROR, 52 | "@typescript-eslint/no-empty-function": OFF, // Has use cases 53 | "@typescript-eslint/no-explicit-any": WARN, // Some 'any' are OK 54 | "@typescript-eslint/no-extra-non-null-assertion": ERROR, 55 | "@typescript-eslint/no-extraneous-class": ERROR, 56 | "@typescript-eslint/no-floating-promises": ERROR, 57 | "@typescript-eslint/no-for-in-array": ERROR, 58 | "@typescript-eslint/no-implicit-any-catch": OFF, // Too extra 59 | "@typescript-eslint/no-implied-eval": ERROR, 60 | "@typescript-eslint/no-inferrable-types": ERROR, 61 | "@typescript-eslint/no-invalid-void-type": ERROR, 62 | "@typescript-eslint/no-misused-new": ERROR, 63 | "@typescript-eslint/no-misused-promises": ERROR, 64 | "@typescript-eslint/no-namespace": ERROR, 65 | "@typescript-eslint/no-non-null-assertion": ERROR, 66 | "@typescript-eslint/no-parameter-properties": ERROR, 67 | "@typescript-eslint/no-require-imports": ERROR, 68 | "@typescript-eslint/no-this-alias": ERROR, 69 | "@typescript-eslint/no-throw-literal": ERROR, 70 | "@typescript-eslint/no-unnecessary-boolean-literal-compare": ERROR, 71 | "@typescript-eslint/no-unnecessary-condition": ERROR, 72 | "@typescript-eslint/no-unnecessary-qualifier": ERROR, 73 | "@typescript-eslint/no-unnecessary-type-arguments": ERROR, 74 | "@typescript-eslint/no-unnecessary-type-assertion": ERROR, 75 | "@typescript-eslint/no-unsafe-assignment": OFF, // Too slow 76 | "@typescript-eslint/no-unsafe-member-access": OFF, // Too slow 77 | "@typescript-eslint/no-unsafe-return": OFF, // Too slow 78 | "@typescript-eslint/no-unused-vars": ERROR, 79 | "@typescript-eslint/no-var-requires": ERROR, 80 | "@typescript-eslint/prefer-for-of": ERROR, 81 | "@typescript-eslint/prefer-function-type": ERROR, 82 | "@typescript-eslint/prefer-includes": ERROR, 83 | "@typescript-eslint/prefer-literal-enum-member": ERROR, 84 | "@typescript-eslint/prefer-namespace-keyword": OFF, // modules > namespaces 85 | "@typescript-eslint/prefer-nullish-coalescing": ERROR, 86 | "@typescript-eslint/prefer-optional-chain": ERROR, 87 | "@typescript-eslint/prefer-readonly": ERROR, 88 | "@typescript-eslint/prefer-readonly-parameter-types": OFF, // Too extra 89 | "@typescript-eslint/prefer-reduce-type-parameter": ERROR, 90 | "@typescript-eslint/prefer-regexp-exec": ERROR, 91 | "@typescript-eslint/prefer-string-starts-ends-with": ERROR, 92 | "@typescript-eslint/prefer-ts-expect-error": ERROR, 93 | "@typescript-eslint/promise-function-async": OFF, // Silly 94 | "@typescript-eslint/require-array-sort-compare": OFF, // No sorting! 95 | "@typescript-eslint/restrict-plus-operands": ERROR, 96 | "@typescript-eslint/restrict-template-expressions": ERROR, 97 | "@typescript-eslint/strict-boolean-expressions": ERROR, 98 | "@typescript-eslint/switch-exhaustiveness-check": ERROR, 99 | "@typescript-eslint/triple-slash-reference": [ERROR, { types: "prefer-import" }], 100 | "@typescript-eslint/type-annotation-spacing": OFF, // Prettier 101 | "@typescript-eslint/typedef": OFF, // Inference 102 | "@typescript-eslint/unbound-method": ERROR, 103 | "@typescript-eslint/unified-signatures": ERROR, 104 | 105 | // Conflicting rules from official docs 106 | "no-duplicate-imports": OFF, // type imports 107 | "no-shadow": OFF, // Documented problem 108 | "no-unused-vars": OFF, // Dupe 109 | "no-use-before-define": OFF, // Documented problem 110 | 111 | // TODO: go through these, maybe some conflict with Prettier 112 | "@typescript-eslint/brace-style": OFF, 113 | "@typescript-eslint/comma-dangle": OFF, 114 | "@typescript-eslint/comma-spacing": OFF, 115 | "@typescript-eslint/consistent-type-exports": OFF, 116 | "@typescript-eslint/default-param-last": OFF, 117 | "@typescript-eslint/dot-notation": OFF, 118 | "@typescript-eslint/func-call-spacing": OFF, 119 | "@typescript-eslint/indent": OFF, 120 | "@typescript-eslint/init-declarations": OFF, 121 | "@typescript-eslint/keyword-spacing": OFF, 122 | "@typescript-eslint/lines-between-class-members": OFF, 123 | "@typescript-eslint/method-signature-style": OFF, 124 | "@typescript-eslint/no-array-constructor": OFF, 125 | "@typescript-eslint/no-confusing-void-expression": OFF, 126 | "@typescript-eslint/no-dupe-class-members": OFF, 127 | "@typescript-eslint/no-duplicate-imports": OFF, 128 | "@typescript-eslint/no-extra-parens": OFF, 129 | "@typescript-eslint/no-extra-semi": OFF, 130 | "@typescript-eslint/no-invalid-this": OFF, 131 | "@typescript-eslint/no-loop-func": OFF, 132 | "@typescript-eslint/no-loss-of-precision": OFF, 133 | "@typescript-eslint/no-magic-numbers": OFF, 134 | "@typescript-eslint/no-meaningless-void-operator": OFF, 135 | "@typescript-eslint/no-non-null-asserted-nullish-coalescing": OFF, 136 | "@typescript-eslint/no-non-null-asserted-optional-chain": OFF, 137 | "@typescript-eslint/no-redeclare": OFF, 138 | "@typescript-eslint/no-restricted-imports": OFF, 139 | "@typescript-eslint/no-shadow": OFF, 140 | "@typescript-eslint/no-type-alias": OFF, 141 | "@typescript-eslint/no-unnecessary-type-constraint": OFF, 142 | "@typescript-eslint/no-unsafe-argument": OFF, 143 | "@typescript-eslint/no-unsafe-call": OFF, 144 | "@typescript-eslint/no-unused-expressions": OFF, 145 | "@typescript-eslint/no-use-before-define": OFF, 146 | "@typescript-eslint/no-useless-constructor": OFF, 147 | "@typescript-eslint/non-nullable-type-assertion-style": OFF, 148 | "@typescript-eslint/object-curly-spacing": OFF, 149 | "@typescript-eslint/padding-line-between-statements": OFF, 150 | "@typescript-eslint/prefer-as-const": OFF, 151 | "@typescript-eslint/prefer-enum-initializers": OFF, 152 | "@typescript-eslint/prefer-return-this-type": OFF, 153 | "@typescript-eslint/quotes": OFF, 154 | "@typescript-eslint/require-await": OFF, 155 | "@typescript-eslint/return-await": OFF, 156 | "@typescript-eslint/semi": OFF, 157 | "@typescript-eslint/sort-type-union-intersection-members": OFF, 158 | "@typescript-eslint/space-before-function-paren": OFF, 159 | "@typescript-eslint/space-infix-ops": OFF, 160 | } 161 | }, 162 | ], 163 | }; 164 | -------------------------------------------------------------------------------- /packages/session/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": false, 4 | "browser": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/session/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.30.0](https://github.com/oreqizer/reactizer/compare/@reactizer/session@0.29.3...@reactizer/session@0.30.0) (2022-02-12) 7 | 8 | 9 | ### Features 10 | 11 | * **eslint-config:** refactor the thang ([50324a2](https://github.com/oreqizer/reactizer/commit/50324a292b5574453d65ba4793ad2fbf5d1427c1)) 12 | 13 | 14 | ### BREAKING CHANGES 15 | 16 | * **eslint-config:** move rules out of index, deps change 17 | 18 | 19 | 20 | 21 | 22 | ## [0.29.3](https://github.com/oreqizer/reactizer/compare/@reactizer/session@0.29.2...@reactizer/session@0.29.3) (2022-01-31) 23 | 24 | **Note:** Version bump only for package @reactizer/session 25 | 26 | 27 | 28 | 29 | 30 | ## [0.29.2](https://github.com/oreqizer/reactizer/compare/@reactizer/session@0.29.1...@reactizer/session@0.29.2) (2021-09-13) 31 | 32 | 33 | ### Bug Fixes 34 | 35 | * **meta:** update dependency js-cookie to v3 ([c7e33cd](https://github.com/oreqizer/reactizer/commit/c7e33cd5daf397581f7a9df09e7eeed99fe31088)) 36 | 37 | 38 | 39 | 40 | 41 | ## [0.29.1](https://github.com/oreqizer/reactizer/compare/@reactizer/session@0.29.0...@reactizer/session@0.29.1) (2020-10-31) 42 | 43 | **Note:** Version bump only for package @reactizer/session 44 | 45 | 46 | 47 | 48 | 49 | # [0.29.0](https://github.com/oreqizer/reactizer/compare/@reactizer/session@0.28.0...@reactizer/session@0.29.0) (2020-10-30) 50 | 51 | 52 | ### Features 53 | 54 | * **eslint-config:** total overhaul ([eb57718](https://github.com/oreqizer/reactizer/commit/eb5771873dc654f0ccaf31c394fdbfa18bc5a0d2)) 55 | 56 | 57 | 58 | 59 | 60 | # [0.28.0](https://github.com/oreqizer/reactizer/compare/@reactizer/session@0.27.1...@reactizer/session@0.28.0) (2020-08-19) 61 | 62 | 63 | ### Features 64 | 65 | * **meta:** big ass cleanup ([75a0487](https://github.com/oreqizer/reactizer/commit/75a0487ef0a281647912a893982ecd380b953b7b)) 66 | 67 | 68 | 69 | 70 | 71 | ## [0.27.1](https://github.com/oreqizer/reactizer/compare/@reactizer/session@0.27.0...@reactizer/session@0.27.1) (2020-01-13) 72 | 73 | **Note:** Version bump only for package @reactizer/session 74 | 75 | 76 | 77 | 78 | 79 | # 0.27.0 (2020-01-10) 80 | 81 | 82 | ### Features 83 | 84 | * **meta:** improved structure and build ([f56a442](https://github.com/oreqizer/reactizer/commit/f56a4428bc8cefc72de43655589d11a23be49793)) 85 | 86 | 87 | 88 | # 0.26.0 (2019-12-16) 89 | 90 | 91 | 92 | # 0.25.0 (2019-12-15) 93 | 94 | 95 | ### Features 96 | 97 | * **session:** implement ([6d76aff](https://github.com/oreqizer/reactizer/commit/6d76affd6d9260036a4b8515498d00e4e2c937b7)) 98 | 99 | 100 | 101 | ## 0.24.5 (2019-12-15) 102 | 103 | 104 | 105 | ## 0.24.4 (2019-12-15) 106 | 107 | 108 | 109 | ## 0.24.3 (2019-12-15) 110 | 111 | 112 | 113 | 114 | 115 | # [0.26.0](https://github.com/oreqizer/reactizer/compare/v0.25.0...v0.26.0) (2019-12-16) 116 | 117 | **Note:** Version bump only for package @reactizer/session 118 | 119 | 120 | 121 | 122 | 123 | # [0.25.0](https://github.com/oreqizer/reactizer/compare/v0.24.5...v0.25.0) (2019-12-15) 124 | 125 | 126 | ### Features 127 | 128 | * **session:** implement ([6d76aff](https://github.com/oreqizer/reactizer/commit/6d76affd6d9260036a4b8515498d00e4e2c937b7)) 129 | 130 | 131 | 132 | 133 | 134 | ## [0.24.5](https://github.com/oreqizer/reactizer/compare/v0.24.4...v0.24.5) (2019-12-15) 135 | 136 | **Note:** Version bump only for package @reactizer/session 137 | 138 | 139 | 140 | 141 | 142 | ## [0.24.4](https://github.com/oreqizer/reactizer/compare/v0.24.3...v0.24.4) (2019-12-15) 143 | 144 | **Note:** Version bump only for package @reactizer/session 145 | 146 | 147 | 148 | 149 | 150 | ## [0.24.3](https://github.com/oreqizer/reactizer/compare/v0.24.2...v0.24.3) (2019-12-15) 151 | 152 | **Note:** Version bump only for package @reactizer/session 153 | -------------------------------------------------------------------------------- /packages/session/README.md: -------------------------------------------------------------------------------- 1 | # @reactizer/session 2 | 3 | Utilities for session stuff. 4 | 5 | ## API 6 | 7 | Local and session storages are checked for existence. 8 | 9 | ```js 10 | import { cookies, localStorage, sessionStorage } from "@reactizer/session"; 11 | 12 | const key = "key"; 13 | const value = "value"; 14 | 15 | cookies.save(key, value); 16 | cookies.load(key); 17 | cookies.remove(key); 18 | 19 | // Same API for 'localStorage' and 'sessionStorage' 20 | ``` 21 | 22 | ## License 23 | 24 | MIT 25 | -------------------------------------------------------------------------------- /packages/session/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from "./lib"; 2 | -------------------------------------------------------------------------------- /packages/session/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@reactizer/session", 3 | "version": "0.30.0", 4 | "description": "Reactizer's session utilities.", 5 | "main": "lib/index.js", 6 | "module": "lib/index.mjs", 7 | "sideEffects": false, 8 | "publishConfig": { 9 | "access": "public" 10 | }, 11 | "scripts": { 12 | "babel": "babel src -d lib --root-mode upward --extensions '.ts,.tsx' --ignore '**/__tests__/*'", 13 | "build:js": "yarn babel", 14 | "build:mjs": "cross-env BABEL_ENV=modules yarn babel --out-file-extension .mjs", 15 | "build": "run-p build:*", 16 | "prebuild": "yarn types", 17 | "types": "tsc", 18 | "posttypes": "rimraf 'lib/**/*.{js,jsx}'" 19 | }, 20 | "files": [ 21 | "lib", 22 | "index.d.ts", 23 | "README.md" 24 | ], 25 | "dependencies": { 26 | "js-cookie": "^3.0.1" 27 | }, 28 | "devDependencies": { 29 | "@types/js-cookie": "^3.0.1" 30 | }, 31 | "license": "MIT", 32 | "gitHead": "e112cf5290897641088833ed937f766f7085d1b5" 33 | } 34 | -------------------------------------------------------------------------------- /packages/session/src/cookies.ts: -------------------------------------------------------------------------------- 1 | import cookie from "js-cookie"; 2 | 3 | type Options = { 4 | expires?: number | Date; 5 | domain?: string; 6 | path?: string; 7 | secure?: boolean; 8 | }; 9 | 10 | export const load = (key: string): string | null => cookie.get(key) ?? null; 11 | 12 | export const save = (key: string, value: string, opts?: Options) => { 13 | cookie.set(key, value, opts); 14 | }; 15 | 16 | export const remove = (key: string, opts?: Options) => { 17 | cookie.remove(key, opts); 18 | }; 19 | -------------------------------------------------------------------------------- /packages/session/src/index.ts: -------------------------------------------------------------------------------- 1 | import * as cookies from "./cookies"; 2 | import * as localStorage from "./localStorage"; 3 | import * as sessionStorage from "./sessionStorage"; 4 | 5 | export { cookies, localStorage, sessionStorage }; 6 | -------------------------------------------------------------------------------- /packages/session/src/localStorage.ts: -------------------------------------------------------------------------------- 1 | const available = () => "localStorage" in window && Boolean(window.localStorage); 2 | 3 | export const load = (key: string): string | null => 4 | available() ? window.localStorage.getItem(key) : null; 5 | 6 | export const save = (key: string, value: string) => { 7 | if (available()) { 8 | try { 9 | window.localStorage.setItem(key, value); 10 | } catch (e) { 11 | // Pass 12 | } 13 | } 14 | }; 15 | 16 | export const remove = (key: string) => { 17 | if (available()) { 18 | window.localStorage.removeItem(key); 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /packages/session/src/sessionStorage.ts: -------------------------------------------------------------------------------- 1 | const available = () => "sessionStorage" in window && Boolean(window.sessionStorage); 2 | 3 | export const load = (key: string): string | null => 4 | available() ? window.sessionStorage.getItem(key) : null; 5 | 6 | export const save = (key: string, value: string) => { 7 | if (available()) { 8 | try { 9 | window.sessionStorage.setItem(key, value); 10 | } catch (e) { 11 | // Pass 12 | } 13 | } 14 | }; 15 | 16 | export const remove = (key: string) => { 17 | if (available()) { 18 | window.sessionStorage.removeItem(key); 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /packages/session/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib" 5 | }, 6 | "include": ["./src"] 7 | } 8 | -------------------------------------------------------------------------------- /packages/webpack/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [0.42.4](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.42.3...@reactizer/webpack@0.42.4) (2022-01-31) 7 | 8 | **Note:** Version bump only for package @reactizer/webpack 9 | 10 | 11 | 12 | 13 | 14 | ## [0.42.3](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.42.2...@reactizer/webpack@0.42.3) (2021-09-13) 15 | 16 | 17 | ### Bug Fixes 18 | 19 | * **webpack:** specify .cjs when requiring 2 ([c2908f6](https://github.com/oreqizer/reactizer/commit/c2908f6d83a9e49c9e01be63899a710e23934890)) 20 | 21 | 22 | 23 | 24 | 25 | ## [0.42.2](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.42.1...@reactizer/webpack@0.42.2) (2021-09-13) 26 | 27 | 28 | ### Bug Fixes 29 | 30 | * **webpack:** specify .cjs when requiring ([1ad77b2](https://github.com/oreqizer/reactizer/commit/1ad77b25629f5f4e6ea386adbc134fbe62f81908)) 31 | 32 | 33 | 34 | 35 | 36 | ## [0.42.1](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.42.0...@reactizer/webpack@0.42.1) (2021-09-13) 37 | 38 | 39 | ### Bug Fixes 40 | 41 | * **meta:** update dependency compression-webpack-plugin to v8 ([6d4be94](https://github.com/oreqizer/reactizer/commit/6d4be9494f12b4671530da47883847172f05fe24)) 42 | * **meta:** update dependency css-loader to v6 ([f8d0bfe](https://github.com/oreqizer/reactizer/commit/f8d0bfe00088bc184b29b4f5485764c517f2dbff)) 43 | * **webpack:** remove deprecated settings ([ad89fc9](https://github.com/oreqizer/reactizer/commit/ad89fc9704418bc9999984b1ed1ca8b99ae37bf5)) 44 | 45 | 46 | 47 | 48 | 49 | # [0.42.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.41.1...@reactizer/webpack@0.42.0) (2021-07-23) 50 | 51 | 52 | ### Bug Fixes 53 | 54 | * **meta:** update dependency mini-css-extract-plugin to v2 ([24bc8bc](https://github.com/oreqizer/reactizer/commit/24bc8bc7fbedbfa90b1e3def6f7aebf8aef0dbb1)) 55 | 56 | 57 | ### Features 58 | 59 | * **webpack:** remove node externals from server ([7a8e591](https://github.com/oreqizer/reactizer/commit/7a8e5916a97327c01b35852a9ccb3bfcb36bc6d4)) 60 | 61 | 62 | 63 | 64 | 65 | ## [0.41.1](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.41.0...@reactizer/webpack@0.41.1) (2021-06-28) 66 | 67 | **Note:** Version bump only for package @reactizer/webpack 68 | 69 | 70 | 71 | 72 | 73 | # [0.41.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.40.1...@reactizer/webpack@0.41.0) (2021-05-13) 74 | 75 | 76 | ### Features 77 | 78 | * **dev:** upgrade deps ([4ce03d9](https://github.com/oreqizer/reactizer/commit/4ce03d96f7b3b43d84750b3ebef7605ea07240d8)) 79 | 80 | 81 | 82 | 83 | 84 | ## [0.40.1](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.40.0...@reactizer/webpack@0.40.1) (2021-05-13) 85 | 86 | 87 | ### Bug Fixes 88 | 89 | * **meta:** update dependency webpack-node-externals to v3 ([810b03f](https://github.com/oreqizer/reactizer/commit/810b03f641f7772ac56fd31e4b668a0503319bc8)) 90 | 91 | 92 | 93 | 94 | 95 | # [0.40.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.39.1...@reactizer/webpack@0.40.0) (2021-03-14) 96 | 97 | 98 | ### Features 99 | 100 | * **webpack:** update entrypoint sizes ([f312c8a](https://github.com/oreqizer/reactizer/commit/f312c8a951f4ff3179864ec8b6e2db0322fd777c)) 101 | 102 | 103 | 104 | 105 | 106 | ## [0.39.1](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.39.0...@reactizer/webpack@0.39.1) (2020-12-01) 107 | 108 | 109 | ### Bug Fixes 110 | 111 | * **meta:** update dependency babel-loader to v8.2.2 ([f8826f1](https://github.com/oreqizer/reactizer/commit/f8826f12a2aede8fcffc95ca6623cf96e5fa4309)) 112 | 113 | 114 | 115 | 116 | 117 | # [0.39.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.38.1...@reactizer/webpack@0.39.0) (2020-11-26) 118 | 119 | 120 | ### Bug Fixes 121 | 122 | * **meta:** update dependency babel-loader to v8.2.0 ([68ffa87](https://github.com/oreqizer/reactizer/commit/68ffa87167446eb5b316d9237d04da6d572c3fc3)) 123 | * **meta:** update dependency babel-loader to v8.2.1 ([3b3a292](https://github.com/oreqizer/reactizer/commit/3b3a292b76e71f9c88ed2b8260cd626d2bacb75f)) 124 | 125 | 126 | ### Features 127 | 128 | * **webpack:** add server ([06ee496](https://github.com/oreqizer/reactizer/commit/06ee496670847f3f22b27ed44548894dd0877415)) 129 | 130 | 131 | 132 | 133 | 134 | ## [0.38.1](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.38.0...@reactizer/webpack@0.38.1) (2020-11-10) 135 | 136 | **Note:** Version bump only for package @reactizer/webpack 137 | 138 | 139 | 140 | 141 | 142 | # [0.38.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.37.0...@reactizer/webpack@0.38.0) (2020-11-10) 143 | 144 | 145 | ### Bug Fixes 146 | 147 | * **meta:** update dependency webpack-bundle-analyzer to v4 ([7ae1fc1](https://github.com/oreqizer/reactizer/commit/7ae1fc1c2f0792cdef046071721436577b36a960)) 148 | 149 | 150 | ### Features 151 | 152 | * **webpack:** add mini-css plugin ([60ae7ec](https://github.com/oreqizer/reactizer/commit/60ae7ecafca782d6ef8a1e9d0580d97340957554)) 153 | 154 | 155 | 156 | 157 | 158 | # [0.37.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.36.7...@reactizer/webpack@0.37.0) (2020-11-05) 159 | 160 | 161 | ### Features 162 | 163 | * **webpack:** add performance to prod ([a0f0c1a](https://github.com/oreqizer/reactizer/commit/a0f0c1a8d4822a03bf20d57a609e26545b1bad21)) 164 | 165 | 166 | 167 | 168 | 169 | ## [0.36.7](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.36.6...@reactizer/webpack@0.36.7) (2020-11-05) 170 | 171 | 172 | ### Bug Fixes 173 | 174 | * **webpack:** cleanup ([443a671](https://github.com/oreqizer/reactizer/commit/443a67135ececeab4293c7127bddb736436c480a)) 175 | 176 | 177 | 178 | 179 | 180 | ## [0.36.6](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.36.5...@reactizer/webpack@0.36.6) (2020-11-05) 181 | 182 | 183 | ### Bug Fixes 184 | 185 | * **webpack:** cleanup ([b0407a3](https://github.com/oreqizer/reactizer/commit/b0407a35e33b99e215b397a59567053429feb3c7)) 186 | 187 | 188 | 189 | 190 | 191 | ## [0.36.5](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.36.4...@reactizer/webpack@0.36.5) (2020-11-05) 192 | 193 | 194 | ### Bug Fixes 195 | 196 | * **webpack:** docc'd api ([dfc5a51](https://github.com/oreqizer/reactizer/commit/dfc5a515377aea326ebbb7f1ec4802516db0ca82)) 197 | 198 | 199 | 200 | 201 | 202 | ## [0.36.4](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.36.3...@reactizer/webpack@0.36.4) (2020-11-05) 203 | 204 | 205 | ### Bug Fixes 206 | 207 | * **webpack:** cleanup ([c57d422](https://github.com/oreqizer/reactizer/commit/c57d422fba0c8c6b37d9dcf54b0cca778038d1a8)) 208 | 209 | 210 | 211 | 212 | 213 | ## [0.36.3](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.36.2...@reactizer/webpack@0.36.3) (2020-11-04) 214 | 215 | 216 | ### Bug Fixes 217 | 218 | * **webpack:** proper config ([b589fdc](https://github.com/oreqizer/reactizer/commit/b589fdc830c28af87f22e7303650c72718b81be1)) 219 | 220 | 221 | 222 | 223 | 224 | ## [0.36.2](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.36.1...@reactizer/webpack@0.36.2) (2020-11-04) 225 | 226 | 227 | ### Bug Fixes 228 | 229 | * **webpack:** proper config ([92a2fca](https://github.com/oreqizer/reactizer/commit/92a2fca4849192d4b9a884bae4159782ca3ee328)) 230 | 231 | 232 | 233 | 234 | 235 | ## [0.36.1](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.36.0...@reactizer/webpack@0.36.1) (2020-11-04) 236 | 237 | 238 | ### Bug Fixes 239 | 240 | * **webpack:** proper mode ([3d91a9a](https://github.com/oreqizer/reactizer/commit/3d91a9ae8823aca0f782f766cd99ef55079ab149)) 241 | 242 | 243 | 244 | 245 | 246 | # [0.36.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.35.0...@reactizer/webpack@0.36.0) (2020-10-31) 247 | 248 | 249 | ### Features 250 | 251 | * **webpack:** update to v5 ([589de54](https://github.com/oreqizer/reactizer/commit/589de54ec7693b7930e829846ca848de0ebdeb46)) 252 | 253 | 254 | 255 | 256 | 257 | # [0.35.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.34.7...@reactizer/webpack@0.35.0) (2020-10-30) 258 | 259 | 260 | ### Features 261 | 262 | * **eslint-config:** total overhaul ([eb57718](https://github.com/oreqizer/reactizer/commit/eb5771873dc654f0ccaf31c394fdbfa18bc5a0d2)) 263 | 264 | 265 | 266 | 267 | 268 | ## [0.34.7](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.34.6...@reactizer/webpack@0.34.7) (2020-08-20) 269 | 270 | 271 | ### Bug Fixes 272 | 273 | * **webpack:** remove redundant deps ([f7e4c4f](https://github.com/oreqizer/reactizer/commit/f7e4c4fa6e07b7501f8d8cab6a2c96f14fc5e217)) 274 | 275 | 276 | 277 | 278 | 279 | ## [0.34.6](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.34.5...@reactizer/webpack@0.34.6) (2020-08-20) 280 | 281 | 282 | ### Bug Fixes 283 | 284 | * **webpack:** remove redundant plugins ([7ff8036](https://github.com/oreqizer/reactizer/commit/7ff80362c5a7880dd5c0003d6ea50cda46e767c8)) 285 | 286 | 287 | 288 | 289 | 290 | ## [0.34.5](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.34.4...@reactizer/webpack@0.34.5) (2020-08-20) 291 | 292 | 293 | ### Bug Fixes 294 | 295 | * **webpack:** extensions 2 ([bf1d1d8](https://github.com/oreqizer/reactizer/commit/bf1d1d8ee5c5314a8dc9c00106e88953285191cd)) 296 | 297 | 298 | 299 | 300 | 301 | ## [0.34.4](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.34.3...@reactizer/webpack@0.34.4) (2020-08-20) 302 | 303 | 304 | ### Bug Fixes 305 | 306 | * **webpack:** extensions ([f0cd74d](https://github.com/oreqizer/reactizer/commit/f0cd74d60edb7b6c48ecb6879975b416ed8f6c5c)) 307 | 308 | 309 | 310 | 311 | 312 | ## [0.34.3](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.34.2...@reactizer/webpack@0.34.3) (2020-08-19) 313 | 314 | **Note:** Version bump only for package @reactizer/webpack 315 | 316 | 317 | 318 | 319 | 320 | ## [0.34.2](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.34.1...@reactizer/webpack@0.34.2) (2020-08-19) 321 | 322 | 323 | ### Bug Fixes 324 | 325 | * **webpack:** use NODE_ENV instead of DEBUG ([161c959](https://github.com/oreqizer/reactizer/commit/161c9590cfebbaae15ec91b8fba59bac9540e90b)) 326 | 327 | 328 | 329 | 330 | 331 | ## [0.34.1](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.34.0...@reactizer/webpack@0.34.1) (2020-08-19) 332 | 333 | 334 | ### Bug Fixes 335 | 336 | * **webpack:** import merge ([c251b01](https://github.com/oreqizer/reactizer/commit/c251b01f2434dc5683868182dfe7899566ca7bc1)) 337 | 338 | 339 | 340 | 341 | 342 | # [0.34.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.33.0...@reactizer/webpack@0.34.0) (2020-08-19) 343 | 344 | 345 | ### Features 346 | 347 | * **webpack:** clean up deps ([c47bcf7](https://github.com/oreqizer/reactizer/commit/c47bcf712bb32fbc8a660d438858910218bbc298)) 348 | 349 | 350 | 351 | 352 | 353 | # [0.33.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.32.0...@reactizer/webpack@0.33.0) (2020-08-19) 354 | 355 | 356 | ### Features 357 | 358 | * **meta:** big ass cleanup ([75a0487](https://github.com/oreqizer/reactizer/commit/75a0487ef0a281647912a893982ecd380b953b7b)) 359 | 360 | 361 | 362 | 363 | 364 | # [0.32.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.31.0...@reactizer/webpack@0.32.0) (2020-02-08) 365 | 366 | 367 | ### Features 368 | 369 | * **webpack:** smaller separate packages ([5bdae20](https://github.com/oreqizer/reactizer/commit/5bdae20d3c145d22e68ca1cd63d95d14ce3a1c79)) 370 | 371 | 372 | 373 | 374 | 375 | # [0.31.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.30.0...@reactizer/webpack@0.31.0) (2020-01-22) 376 | 377 | 378 | ### Features 379 | 380 | * **webpack:** increase minimal lib size to reduce granularity ([73cecc8](https://github.com/oreqizer/reactizer/commit/73cecc82edff52a5f19b87304df8afe56931ad4f)) 381 | 382 | 383 | 384 | 385 | 386 | # [0.30.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.29.5...@reactizer/webpack@0.30.0) (2020-01-21) 387 | 388 | 389 | ### Features 390 | 391 | * **webpack:** also generate gzip ([1d974c4](https://github.com/oreqizer/reactizer/commit/1d974c43ba4c18111390c4a147bc08821b5c5fa3)) 392 | 393 | 394 | 395 | 396 | 397 | ## [0.29.5](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.29.4...@reactizer/webpack@0.29.5) (2020-01-21) 398 | 399 | 400 | ### Bug Fixes 401 | 402 | * **webpack:** debug ([028e420](https://github.com/oreqizer/reactizer/commit/028e4208e9e411b21faff5383c66b5796fcd9db3)) 403 | 404 | 405 | 406 | 407 | 408 | ## [0.29.4](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.29.3...@reactizer/webpack@0.29.4) (2020-01-21) 409 | 410 | 411 | ### Bug Fixes 412 | 413 | * **webpack:** parse required envs ([83d9e06](https://github.com/oreqizer/reactizer/commit/83d9e065092687e6fe7b4097ab7cc6544a794de7)) 414 | 415 | 416 | 417 | 418 | 419 | ## [0.29.3](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.29.2...@reactizer/webpack@0.29.3) (2020-01-21) 420 | 421 | 422 | ### Bug Fixes 423 | 424 | * **webpack:** parse all envs ([7a62f8d](https://github.com/oreqizer/reactizer/commit/7a62f8d82c79518454687966182e5a6bd83bfa5e)) 425 | 426 | 427 | 428 | 429 | 430 | ## [0.29.2](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.29.1...@reactizer/webpack@0.29.2) (2020-01-21) 431 | 432 | **Note:** Version bump only for package @reactizer/webpack 433 | 434 | 435 | 436 | 437 | 438 | ## [0.29.1](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.29.0...@reactizer/webpack@0.29.1) (2020-01-13) 439 | 440 | **Note:** Version bump only for package @reactizer/webpack 441 | 442 | 443 | 444 | 445 | 446 | # [0.29.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.28.0...@reactizer/webpack@0.29.0) (2020-01-10) 447 | 448 | 449 | ### Features 450 | 451 | * **meta:** improved structure and build ([f56a442](https://github.com/oreqizer/reactizer/commit/f56a4428bc8cefc72de43655589d11a23be49793)) 452 | 453 | 454 | 455 | 456 | 457 | # [0.28.0](https://github.com/oreqizer/reactizer/compare/@reactizer/webpack@0.27.0...@reactizer/webpack@0.28.0) (2020-01-09) 458 | 459 | 460 | ### Features 461 | 462 | * **webpack:** fix env ([44fa58b](https://github.com/oreqizer/reactizer/commit/44fa58bac8990f8985b144b9f9d93f9ca5ae01e0)) 463 | 464 | 465 | 466 | 467 | 468 | # 0.27.0 (2019-12-17) 469 | 470 | 471 | ### Bug Fixes 472 | 473 | * **webpack:** env var for visualization ([7c8f765](https://github.com/oreqizer/reactizer/commit/7c8f765bcaaf9880ff2e386e8e84c1eae59a1eb0)) 474 | 475 | 476 | 477 | # 0.26.0 (2019-12-16) 478 | 479 | 480 | 481 | # 0.25.0 (2019-12-15) 482 | 483 | 484 | 485 | ## 0.24.5 (2019-12-15) 486 | 487 | 488 | 489 | ## 0.24.4 (2019-12-15) 490 | 491 | 492 | 493 | ## 0.24.3 (2019-12-15) 494 | 495 | 496 | 497 | ## 0.24.2 (2019-12-15) 498 | 499 | 500 | ### Bug Fixes 501 | 502 | * **webpack:** don't open ([165bf6d](https://github.com/oreqizer/reactizer/commit/165bf6dc79a793bac5651f7d44486fffbed36142)) 503 | 504 | 505 | 506 | ## 0.24.1 (2019-12-15) 507 | 508 | 509 | 510 | # 0.24.0 (2019-12-15) 511 | 512 | 513 | 514 | # 0.23.0 (2019-12-14) 515 | 516 | 517 | 518 | # 0.22.0 (2019-12-12) 519 | 520 | 521 | 522 | ## 0.21.4 (2019-12-12) 523 | 524 | 525 | 526 | # 0.21.0 (2019-12-09) 527 | 528 | 529 | 530 | # 0.20.0 (2019-12-09) 531 | 532 | 533 | 534 | # 0.19.0 (2019-12-08) 535 | 536 | 537 | 538 | # 0.18.0 (2019-12-03) 539 | 540 | 541 | ### Features 542 | 543 | * **meta:** add @reactizer/webpack ([7b89939](https://github.com/oreqizer/reactizer/commit/7b8993946072496a4ea437470571aa65eebc5126)) 544 | 545 | 546 | 547 | 548 | 549 | # [0.26.0](https://github.com/oreqizer/reactizer/compare/v0.25.0...v0.26.0) (2019-12-16) 550 | 551 | **Note:** Version bump only for package @reactizer/webpack 552 | 553 | 554 | 555 | 556 | 557 | # [0.25.0](https://github.com/oreqizer/reactizer/compare/v0.24.5...v0.25.0) (2019-12-15) 558 | 559 | **Note:** Version bump only for package @reactizer/webpack 560 | 561 | 562 | 563 | 564 | 565 | ## [0.24.5](https://github.com/oreqizer/reactizer/compare/v0.24.4...v0.24.5) (2019-12-15) 566 | 567 | **Note:** Version bump only for package @reactizer/webpack 568 | 569 | 570 | 571 | 572 | 573 | ## [0.24.4](https://github.com/oreqizer/reactizer/compare/v0.24.3...v0.24.4) (2019-12-15) 574 | 575 | **Note:** Version bump only for package @reactizer/webpack 576 | 577 | 578 | 579 | 580 | 581 | ## [0.24.3](https://github.com/oreqizer/reactizer/compare/v0.24.2...v0.24.3) (2019-12-15) 582 | 583 | **Note:** Version bump only for package @reactizer/webpack 584 | 585 | 586 | 587 | 588 | 589 | ## [0.24.2](https://github.com/oreqizer/reactizer/compare/v0.24.1...v0.24.2) (2019-12-15) 590 | 591 | 592 | ### Bug Fixes 593 | 594 | * **webpack:** don't open ([165bf6d](https://github.com/oreqizer/reactizer/commit/165bf6dc79a793bac5651f7d44486fffbed36142)) 595 | 596 | 597 | 598 | 599 | 600 | ## [0.24.1](https://github.com/oreqizer/reactizer/compare/v0.24.0...v0.24.1) (2019-12-15) 601 | 602 | **Note:** Version bump only for package @reactizer/webpack 603 | 604 | 605 | 606 | 607 | 608 | # [0.24.0](https://github.com/oreqizer/reactizer/compare/v0.23.0...v0.24.0) (2019-12-15) 609 | 610 | **Note:** Version bump only for package @reactizer/webpack 611 | 612 | 613 | 614 | 615 | 616 | # [0.23.0](https://github.com/oreqizer/reactizer/compare/v0.22.0...v0.23.0) (2019-12-14) 617 | 618 | **Note:** Version bump only for package @reactizer/webpack 619 | 620 | 621 | 622 | 623 | 624 | # [0.22.0](https://github.com/oreqizer/reactizer/compare/v0.21.4...v0.22.0) (2019-12-12) 625 | 626 | **Note:** Version bump only for package @reactizer/webpack 627 | 628 | 629 | 630 | 631 | 632 | ## [0.21.4](https://github.com/oreqizer/reactizer/compare/v0.21.3...v0.21.4) (2019-12-12) 633 | 634 | **Note:** Version bump only for package @reactizer/webpack 635 | 636 | 637 | 638 | 639 | 640 | # [0.21.0](https://github.com/oreqizer/reactizer/compare/v0.20.0...v0.21.0) (2019-12-09) 641 | 642 | **Note:** Version bump only for package @reactizer/webpack 643 | 644 | 645 | 646 | 647 | 648 | # [0.20.0](https://github.com/oreqizer/reactizer/compare/v0.19.2...v0.20.0) (2019-12-09) 649 | 650 | **Note:** Version bump only for package @reactizer/webpack 651 | 652 | 653 | 654 | 655 | 656 | # [0.19.0](https://github.com/oreqizer/reactizer/compare/v0.18.1...v0.19.0) (2019-12-08) 657 | 658 | **Note:** Version bump only for package @reactizer/webpack 659 | 660 | 661 | 662 | 663 | 664 | # [0.18.0](https://github.com/oreqizer/reactizer/compare/v0.17.0...v0.18.0) (2019-12-03) 665 | 666 | 667 | ### Features 668 | 669 | * **meta:** add @reactizer/webpack ([7b89939](https://github.com/oreqizer/reactizer/commit/7b8993946072496a4ea437470571aa65eebc5126)) 670 | -------------------------------------------------------------------------------- /packages/webpack/README.md: -------------------------------------------------------------------------------- 1 | # @reactizer/webpack 2 | 3 | The best Webpack config. 4 | 5 | ## Setup 6 | 7 | `webpack.config.js` 8 | 9 | ```js 10 | const reactizer = require("@reactizer/webpack"); 11 | const { merge } = require("webpack-merge"); 12 | 13 | module.exports = merge(reactizer, { 14 | entry: { 15 | // your entrypoints 16 | }, 17 | output: { 18 | // your output 19 | }, 20 | }); 21 | ``` 22 | 23 | `package.json` 24 | 25 | ```json 26 | { 27 | "scripts": { 28 | "webpack": "webpack --env production", 29 | "webpack:dev": "webpack serve --mode development", 30 | "webpack:stats": "webpack --env production --json > stats.json" 31 | } 32 | } 33 | ``` 34 | 35 | ## License 36 | 37 | MIT 38 | -------------------------------------------------------------------------------- /packages/webpack/index.cjs: -------------------------------------------------------------------------------- 1 | const { merge } = require("webpack-merge"); 2 | const MiniCssExtractPlugin = require("mini-css-extract-plugin"); 3 | 4 | const prod = require("./parts/prod.cjs"); 5 | const dev = require("./parts/dev.cjs"); 6 | const shared = require("./parts/shared.cjs"); 7 | 8 | const common = (production) => 9 | merge(shared, { 10 | module: { 11 | rules: [ 12 | { 13 | test: /\.css$/, 14 | use: [ 15 | MiniCssExtractPlugin.loader, 16 | { 17 | loader: "css-loader", 18 | options: { 19 | url: false, 20 | sourceMap: production, 21 | }, 22 | }, 23 | ], 24 | }, 25 | ], 26 | }, 27 | plugins: [ 28 | new MiniCssExtractPlugin({ 29 | filename: production ? "[name].[contenthash:8].css" : "[name].css", 30 | chunkFilename: production ? "[name].[contenthash:8].css" : "[name].css", 31 | }), 32 | ], 33 | }); 34 | 35 | module.exports = (env, argv) => { 36 | const production = argv.mode === "production"; 37 | 38 | if (production) { 39 | return merge(common(production), prod); 40 | } 41 | 42 | return merge(common(production), dev); 43 | }; 44 | -------------------------------------------------------------------------------- /packages/webpack/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@reactizer/webpack", 3 | "version": "0.42.4", 4 | "description": "The best Webpack config.", 5 | "publishConfig": { 6 | "access": "public" 7 | }, 8 | "main": "index.js", 9 | "author": "oreqizer", 10 | "license": "MIT", 11 | "scripts": {}, 12 | "dependencies": { 13 | "babel-loader": "8.2.4", 14 | "compression-webpack-plugin": "^9.2.0", 15 | "css-loader": "^6.5.1", 16 | "mini-css-extract-plugin": "^2.5.3", 17 | "webpack-bundle-analyzer": "^4.5.0", 18 | "webpack-merge": "^5.8.0" 19 | }, 20 | "peerDependencies": { 21 | "webpack": "^5.3.1" 22 | }, 23 | "gitHead": "72a4ac5c1b5c307ec284ddc7ee6380eb66f5de6d" 24 | } 25 | -------------------------------------------------------------------------------- /packages/webpack/parts/dev.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | output: { 3 | publicPath: "/", 4 | }, 5 | devtool: "cheap-module-source-map", 6 | devServer: { 7 | hot: true, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /packages/webpack/parts/prod.cjs: -------------------------------------------------------------------------------- 1 | const CompressionPlugin = require("compression-webpack-plugin"); 2 | const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer"); 3 | 4 | module.exports = { 5 | performance: { 6 | maxEntrypointSize: 2500000, 7 | maxAssetSize: 500000, 8 | }, 9 | output: { 10 | filename: "[name].[contenthash:8].js", 11 | publicPath: "/", 12 | }, 13 | optimization: { 14 | moduleIds: "deterministic", 15 | // https://hackernoon.com/the-100-correct-way-to-split-your-chunks-with-webpack-f8a9df5b7758 16 | runtimeChunk: "single", 17 | splitChunks: { 18 | chunks: "all", 19 | maxInitialRequests: Infinity, 20 | minSize: 64000, // 64kb raw 21 | cacheGroups: { 22 | defaultVendors: { 23 | test: /\/node_modules\//, 24 | name(module) { 25 | // top-level package name 26 | const { 27 | groups: { scope, pkg }, 28 | } = module.context.match(/\/node_modules\/(?@.*?\/)?(?.*?)(?:\/|$)/); 29 | 30 | // some servers don't like @ symbols 31 | return `npm.${scope ? `${scope.replace("@", "").replace("/", "")}__${pkg}` : pkg}`; 32 | }, 33 | }, 34 | }, 35 | }, 36 | }, 37 | plugins: [ 38 | new CompressionPlugin({ 39 | filename: "[path][base].gz[query]", 40 | algorithm: "gzip", 41 | }), 42 | new CompressionPlugin({ 43 | filename: "[path][base].br[query]", 44 | algorithm: "brotliCompress", 45 | }), 46 | new BundleAnalyzerPlugin({ 47 | analyzerMode: "static", 48 | openAnalyzer: false, 49 | }), 50 | ], 51 | }; 52 | -------------------------------------------------------------------------------- /packages/webpack/parts/shared.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | resolve: { 3 | extensions: [".ts", ".tsx", ".mjs", ".js", ".jsx", ".json"], 4 | }, 5 | module: { 6 | rules: [ 7 | { 8 | test: /\.tsx?$/, 9 | use: ["babel-loader"], 10 | exclude: /node_modules/, 11 | }, 12 | { 13 | test: /\.m?js$/, 14 | type: "javascript/auto", 15 | include: /node_modules/, 16 | resolve: { 17 | fullySpecified: false, 18 | }, 19 | }, 20 | ], 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /packages/webpack/server.cjs: -------------------------------------------------------------------------------- 1 | const { merge } = require("webpack-merge"); 2 | 3 | const shared = require("./parts/shared.cjs"); 4 | 5 | module.exports = () => { 6 | return merge(shared, { 7 | target: "node", 8 | mode: "none", 9 | optimization: { 10 | minimize: false, 11 | }, 12 | devtool: "source-map", 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["config:base", ":preserveSemverRanges"], 3 | "semanticCommits": true, 4 | "semanticCommitScope": "dev", 5 | "packageRules": [ 6 | { 7 | "updateTypes": ["minor", "patch", "pin", "digest"], 8 | "automerge": true 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | // Target latest version of ECMAScript. 4 | "target": "esnext", 5 | // Search under node_modules for non-relative imports. 6 | "moduleResolution": "node", 7 | // Keep JSX intact 8 | "jsx": "preserve", 9 | // Generate .d.ts files 10 | "declaration": true, 11 | // ...into the lib/ directory 12 | "outDir": "lib", 13 | // Enable strictest settings like strictNullChecks & noImplicitAny. 14 | "strict": true, 15 | // Import non-ES modules as default imports. 16 | "esModuleInterop": true 17 | } 18 | } 19 | --------------------------------------------------------------------------------