Browse Source

ok i think everything works again, maybe last webpack/deps commit for a while

py3-upgrade
Noah Hall 4 years ago
parent
commit
393ca84f23
6 changed files with 1726 additions and 83 deletions
  1. +318
    -0
      .eslintrc.json
  2. +1
    -1
      browser/src/js/options.js
  3. +3
    -3
      frontend/src/components/LoginOrRegister/LoginOrRegister.jsx
  4. +4
    -3
      package.json
  5. +30
    -36
      webpack.config.js
  6. +1370
    -40
      yarn.lock

+ 318
- 0
.eslintrc.json View File

@ -0,0 +1,318 @@
{
"env": {
"browser": true,
"es6": true,
"webextensions": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"accessor-pairs": "error",
"array-bracket-spacing": [
"error",
"never"
],
"array-callback-return": "error",
"arrow-body-style": "off",
"arrow-parens": [
"error",
"always"
],
"arrow-spacing": [
"error",
{
"after": true,
"before": true
}
],
"block-scoped-var": "error",
"block-spacing": [
"error",
"always"
],
"brace-style": [
"error",
"1tbs",
{
"allowSingleLine": true
}
],
"callback-return": "error",
"camelcase": "off",
"capitalized-comments": [
"error",
"never"
],
"class-methods-use-this": "error",
"comma-dangle": "error",
"comma-spacing": [
"error",
{
"after": true,
"before": false
}
],
"comma-style": [
"error",
"last"
],
"complexity": "error",
"computed-property-spacing": [
"error",
"never"
],
"consistent-return": "off",
"consistent-this": "error",
"curly": "error",
"default-case": "off",
"dot-location": [
"error",
"property"
],
"dot-notation": "off",
"eol-last": "error",
"eqeqeq": "off",
"func-call-spacing": "error",
"func-name-matching": "error",
"func-names": [
"error",
"never"
],
"func-style": [
"error",
"expression"
],
"generator-star-spacing": "error",
"global-require": "error",
"guard-for-in": "error",
"handle-callback-err": "error",
"id-blacklist": "error",
"id-length": "off",
"id-match": "error",
"indent": "off",
"init-declarations": "error",
"jsx-quotes": "error",
"key-spacing": "error",
"keyword-spacing": [
"error",
{
"after": true,
"before": true
}
],
"line-comment-position": "off",
"linebreak-style": [
"error",
"unix"
],
"lines-around-comment": "error",
"lines-around-directive": "error",
"max-depth": "error",
"max-len": "off",
"max-lines": "error",
"max-nested-callbacks": "error",
"max-params": "error",
"max-statements": "off",
"max-statements-per-line": "error",
"multiline-ternary": [
"error",
"never"
],
"new-cap": "error",
"new-parens": "error",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "error",
"no-alert": "error",
"no-array-constructor": "error",
"no-await-in-loop": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-catch-shadow": "error",
"no-compare-neg-zero": "error",
"no-confusing-arrow": "error",
"no-continue": "error",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "off",
"no-empty-function": "error",
"no-eq-null": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "off",
"no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-invalid-this": "error",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-loop-func": "error",
"no-magic-numbers": "off",
"no-mixed-operators": "error",
"no-mixed-requires": "error",
"no-multi-assign": "error",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-multiple-empty-lines": "error",
"no-native-reassign": "error",
"no-negated-condition": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "error",
"no-path-concat": "error",
"no-plusplus": [
"error",
{
"allowForLoopAfterthoughts": true
}
],
"no-process-env": "error",
"no-process-exit": "error",
"no-proto": "error",
"no-prototype-builtins": "error",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "off",
"no-shadow-restricted-names": "error",
"no-spaced-func": "error",
"no-sync": "error",
"no-tabs": "error",
"no-template-curly-in-string": "error",
"no-ternary": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "off",
"no-undef-init": "error",
"no-undefined": "error",
"no-underscore-dangle": "error",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": [
"error",
{
"defaultAssignment": true
}
],
"no-unused-expressions": "error",
"no-use-before-define": "off",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-escape": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-var": "error",
"no-void": "error",
"no-warning-comments": "off",
"no-whitespace-before-property": "error",
"no-with": "error",
"nonblock-statement-body-position": "error",
"object-curly-newline": "error",
"object-curly-spacing": "off",
"object-property-newline": [
"error",
{
"allowMultiplePropertiesPerLine": true
}
],
"object-shorthand": "error",
"one-var": "off",
"one-var-declaration-per-line": "error",
"operator-assignment": [
"error",
"always"
],
"operator-linebreak": "error",
"padded-blocks": "off",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-destructuring": "error",
"prefer-numeric-literals": "error",
"prefer-promise-reject-errors": "error",
"prefer-reflect": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": "error",
"require-await": "error",
"require-jsdoc": "off",
"rest-spread-spacing": "error",
"semi": "off",
"semi-spacing": [
"error",
{
"after": true,
"before": false
}
],
"sort-imports": "off",
"sort-keys": "off",
"sort-vars": "error",
"space-before-blocks": "error",
"space-before-function-paren": "off",
"space-in-parens": "off",
"space-infix-ops": "off",
"space-unary-ops": [
"error",
{
"nonwords": false,
"words": false
}
],
"spaced-comment": [
"error",
"always"
],
"strict": "error",
"symbol-description": "error",
"template-curly-spacing": [
"error",
"never"
],
"template-tag-spacing": "error",
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "error",
"vars-on-top": "error",
"wrap-iife": "error",
"wrap-regex": "error",
"yield-star-spacing": "error",
"yoda": [
"error",
"never"
]
}
}

+ 1
- 1
browser/src/js/options.js View File

@ -1,4 +1,4 @@
import 'logout' from './logout'
import logout from './logout'
document.onLoad( function () {
document.getElementById('logout').addEventListener('click', () => {


+ 3
- 3
frontend/src/components/LoginOrRegister/LoginOrRegister.jsx View File

@ -2,7 +2,7 @@ import React from 'react'
import LoginForm from '../LoginForm/LoginForm'
import RegisterForm from '../RegisterForm/RegisterForm'
import style from './loginorregister.scss'
import './loginorregister.scss'
export default class LoginOrRegister extends React.Component {
constructor(props) {
@ -41,8 +41,8 @@ export default class LoginOrRegister extends React.Component {
</a>
</span>
</div>
{this.state.register ?
<RegisterForm submit={this.props.submit} />
{this.state.register ?
<RegisterForm submit={this.props.submit} />
:
<LoginForm submit={this.props.submit} />
}


+ 4
- 3
package.json View File

@ -20,11 +20,12 @@
"clean-webpack-plugin": "^0.1.18",
"copy-webpack-plugin": "^4.3.1",
"css-loader": "^0.28.1",
"html-webpack-plugin": "^2.30.1",
"eslint": "^5.6.1",
"eslint-plugin-react": "^7.11.1",
"html-webpack-plugin": "^3.0.0",
"jquery": "^3.3.1",
"js-cookie": "^2.2.0",
"less": "^2.7.3",
"less-loader": "^4.0.5",
"node-sass": "^4.7.2",
"prop-types": "^15.6.0",
"react": "^16.2.0",
@ -35,7 +36,7 @@
"sass-loader": "^6.0.6",
"style-loader": "^0.20.1",
"webpack": "^4.8.3",
"webpack-bundle-tracker": "0.2.1",
"webpack-bundle-tracker": "^0.3.0",
"webpack-cli": "^3.1.2"
}
}

+ 30
- 36
webpack.config.js View File

@ -1,33 +1,33 @@
//require our dependencies
var path = require('path');
var webpack = require('webpack');
var BundleTracker = require('webpack-bundle-tracker');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var CleanWebpackPlugin = require('clean-webpack-plugin');
// require our dependencies
const path = require('path');
const webpack = require('webpack');
const BundleTracker = require('webpack-bundle-tracker')
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = [
{
name: 'site',
//the base directory (absolute path) for resolving the entry option
// the base directory (absolute path) for resolving the entry option
context: __dirname,
//the entry point we created earlier. Note that './' means
//your current directory. You don't have to specify the extension now,
//because you will specify extensions later in the `resolve` section
// the entry point we created earlier. Note that './' means
// your current directory. You don't have to specify the extension now,
// because you will specify extensions later in the `resolve` section
entry: {
main: './frontend/src/index',
main: './frontend/src/index'
},
output: {
//where you want your compiled bundle to be stored
// where you want your compiled bundle to be stored
path: path.resolve('./frontend/bundles/'),
//naming convention webpack should use for your files
filename: '[name]-[hash].js',
// naming convention webpack should use for your files
filename: '[name]-[hash].js'
},
plugins: [
//tells webpack where to store data about your bundles.
new BundleTracker({filename: './webpack-stats.json'}),
//makes jQuery available in every module
// tells webpack where to store data about your bundles
new BundleTracker({filename: './webpack-stats.json'}),
// makes jQuery available in every module
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
@ -40,41 +40,35 @@ module.exports = [
module: {
rules: [
//a regexp that tells webpack use the following loaders on all
//.js and .jsx files
// a regexp that tells webpack use the following loaders on all
// .js and .jsx files
{
test: /\.jsx?$/,
//we definitely don't want babel to transpile all the files in
//node_modules. That would take a long time.
// we definitely don't want babel to transpile all the files in
// node_modules. That would take a long time.
exclude: /node_modules/,
//use the babel loader
// use the babel loader
loader: 'babel-loader',
query: {
//specify that we will be dealing with React code
// specify that we will be dealing with React code
presets: ['react', 'env']
}
},
{
test: /\.scss$/,
use: [
{
loader: 'style-loader'
},
{
loader: 'css-loader'
},
{
loader: 'sass-loader'
}
'style-loader',
'css-loader',
'sass-loader'
]
}
]
},
resolve: {
//tells webpack where to look for modules
// tells webpack where to look for modules
modules: ['node_modules'],
//extensions that should be used to resolve modules
// extensions that should be used to resolve modules
extensions: ['.js', '.jsx']
}
},
@ -93,13 +87,13 @@ module.exports = [
},
plugins: [
new BundleTracker({filename: './extension-stats.json'}),
new BundleTracker({filename: './browser-stats.json'}),
new CopyWebpackPlugin([
{from: './src/manifest.json'},
{from: './src/media', to: 'media'},
{from: './src/css', to: 'css'},
{from: './src/html', to: 'html'}
]),
])
],
module: {


+ 1370
- 40
yarn.lock
File diff suppressed because it is too large
View File


Loading…
Cancel
Save