Skip to content

Commit

Permalink
upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Even Alander committed Oct 1, 2020
1 parent ec1ebea commit 8a5a5e0
Show file tree
Hide file tree
Showing 5 changed files with 5,892 additions and 224 deletions.
158 changes: 5 additions & 153 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,157 +1,9 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true
"browser": true,
"node": true
},
"plugins": [
"babel",
"import"
],
"rules": {
/* http://eslint.org/docs/rules/#possible-errors */
"comma-dangle": [2, "always"],
"no-cond-assign": 2,
"no-console": 2,
"no-constant-condition": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-empty": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": 2,
"no-extra-semi": 2,
"no-func-assign": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-negated-in-lhs": 2,
"no-obj-calls": 2,
"no-regex-spaces": 2,
"no-sparse-arrays": 2,
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"use-isnan": 2,
"valid-jsdoc": 2,
"valid-typeof": 2,

/* http://eslint.org/docs/rules/#best-practices */
"accessor-pairs": 1,
"block-scoped-var": 1,
"complexity": 1,
"consistent-return": 1,
"curly": 1,
"default-case": 1,
"dot-location": 1,
"dot-notation": 1,
"eqeqeq": 1,
"guard-for-in": 1,
"no-alert": 1,
"no-caller": 1,
"no-case-declarations": 1,
"no-div-regex": 1,
"no-else-return": 1,
"no-empty-label": 1,
"no-empty-pattern": 1,
"no-eq-null": 1,
"no-eval": 1,
"no-extend-native": 1,
"no-extra-bind": 1,
"no-fallthrough": 1,
"no-floating-decimal": 1,
"no-implicit-coercion": 1,
"no-implied-eval": 1,
"no-invalid-this": 1,
"no-iterator": 1,
"no-labels": 1,
"no-lone-blocks": 1,
"no-loop-func": 1,
"no-magic-numbers": 1,
"no-multi-spaces": 1,
"no-multi-str": 1,
"no-native-reassign": 1,
"no-new-func": 1,
"no-new-wrappers": 1,
"no-new": 1,
"no-octal-escape": 1,
"no-octal": 1,
"no-param-reassign": 1,
"no-process-env": 0,
"no-proto": 1,
"no-redeclare": 1,
"no-return-assign": 1,
"no-script-url": 1,
"no-self-compare": 1,
"no-sequences": 1,
"no-throw-literal": 1,
"no-unused-expressions": 1,
"no-useless-call": 1,
"no-useless-concat": 1,
"no-void": 1,
"no-warning-comments": 1,
"no-with": 1,
"radix": 1,
"vars-on-top": 1,
"wrap-iife": 1,
"yoda": 1,

/* http://eslint.org/docs/rules/#strict-mode */
"strict": [2, "global"],

/* http://eslint.org/docs/rules/#variables */
"init-declarations": 0,
"no-catch-shadow": 2,
"no-delete-var": 2,
"no-label-var": 2,
"no-shadow-restricted-names": 2,
"no-shadow": 2,
"no-undef-init": 2,
"no-undef": 2,
"no-undefined": 2,
"no-unused-vars": 2,
"no-use-before-define": 2,

/* http://eslint.org/docs/rules/#stylistic-issues */
"camelcase": 1,
"eol-last": 1,
"indent": [1, "tab"],
"jsx-quotes": 1,
"max-len": [1, 120, 4],
"new-cap": 1,
"no-array-constructor": 2,
"no-bitwise": 1,
"no-continue": 1,
"no-lonely-if": 1,
"no-multiple-empty-lines": [2, {"max": 2}],
"no-negated-condition": 1,
"no-nested-ternary": 1,
"no-new-object": 1,
"no-plusplus": 0,
"no-spaced-func": 1,
"no-unneeded-ternary": 1,
"require-jsdoc": 0, // if ever this should be docummented more properly
"semi": [2, "always"],
"sort-vars": 1,
"space-after-keywords": 1,
"space-before-blocks": 1,

"import/no-unresolved": [2, {"commonjs": true, "amd": false}],
"import/named": 2,
"import/namespace": 2,
"import/default": 2,
"import/export": 2,

/* babel plugin https://github.com/babel/eslint-plugin-babel#rules */
"babel/generator-star-spacing": 1,
"babel/new-cap": 1,
// "babel/array-bracket-spacing": 1,
"babel/object-curly-spacing": 1,
"babel/object-shorthand": 0,
"babel/arrow-parens": 1,
"babel/no-await-in-loop": 1
}
}
"plugins": ["babel", "import"],
"extends": ["eslint:recommended", "prettier"]
}
58 changes: 31 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
{
"name": "snake",
"version": "1.0.0",
"private": true,
"description": "A recreation of snake",
"keywords": [
"game",
"snake"
],
"repository": {
"type": "git",
"url": "[email protected]:deificx/snake.git"
},
"license": "UNLICENSED",
"author": "Even Alander",
"main": "src/snake.js",
"scripts": {
"dev": "webpack-dev-server -d src/game.js --content-base src --hot",
"start": "webpack -p",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {},
"devDependencies": {
"animation-frame": "^0.2.5",
"@babel/core": "^7.11.6",
"animation-frame": "^0.3.0",
"babel-core": "^6.3.26",
"babel-eslint": "^4.1.6",
"babel-loader": "^6.2.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"babel-plugin-transform-runtime": "^6.3.13",
"babel-preset-es2015": "^6.3.13",
"babel-runtime": "^6.3.19",
"eslint": "^1.10.3",
"eslint-loader": "^1.1.1",
"eslint-plugin-babel": "^3.0.0",
"eslint-plugin-import": "^0.12.1",
"eventemitter3": "^1.1.1",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
},
"scripts": {
"dev": "./node_modules/.bin/webpack-dev-server src/game.js --content-base src --hot",
"start": "./node_modules/.bin/webpack",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "[email protected]:deificx/snake.git"
},
"keywords": [
"game",
"snake"
],
"author": "Even Alander",
"license": "UNLICENSED",
"private": true
"eslint": "^7.10.0",
"eslint-config-prettier": "^6.12.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.22.1",
"eventemitter3": "^4.0.7",
"html-webpack-plugin": "^4.5.0",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
}
}
14 changes: 7 additions & 7 deletions src/constants.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use strict";

export const UP = 'UP';
export const RIGHT = 'RIGHT';
export const DOWN = 'DOWN';
export const LEFT = 'LEFT';
export const UP = "UP";
export const RIGHT = "RIGHT";
export const DOWN = "DOWN";
export const LEFT = "LEFT";

export const IDLE = 'IDLE';
export const STARTED = 'STARTED';
export const ENDED = 'ENDED';
export const IDLE = "IDLE";
export const STARTED = "STARTED";
export const ENDED = "ENDED";

export const COOLDOWN = 250;
export const SCORE_CAP = 150;
Expand Down
61 changes: 24 additions & 37 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,26 @@
var path = require('path');
var webpack = require('webpack');
const { resolve } = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = {
entry: path.join(__dirname, 'src', 'game.js'),
output: {
filename: 'snake.js',
path: path.join(__dirname, 'dist'),
publicPath: '',
},
module: {
preLoaders: [
{
test: /\.js$/,
include: path.join(__dirname, 'src'),
loader: 'eslint?{fix:true}'
}
],
loaders: [
{
test: /\.js$/,
include: path.join(__dirname, 'src'),
loader: 'babel',
query: {
plugins: ['transform-runtime'],
presets: ['es2015']
}
}
]
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(true),
new webpack.optimize.UglifyJsPlugin({
output: {
comments: false
}
}),
]
}
devtool: "source-map",
entry: resolve(__dirname, "src", "game.js"),
output: {
filename: "snake.js",
path: resolve(__dirname, "dist"),
publicPath: "",
},
module: {
rules: [
{
test: /\.js$/,
loader: "eslint-loader?{fix:true}",
enforce: "pre",
},
{
test: /\.js$/,
loader: "babel-loader",
},
],
},
plugins: [new HtmlWebpackPlugin({ title: "Snake" })],
};
Loading

0 comments on commit 8a5a5e0

Please sign in to comment.