Skip to content

Commit

Permalink
Fixing eslint warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
JanEricNitschke committed Aug 7, 2023
1 parent e0f209f commit e234150
Show file tree
Hide file tree
Showing 6 changed files with 832 additions and 570 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
extends: ["eslint:recommended", "google", "prettier"],
parser: "@babel/eslint-parser",
parserOptions: {
requireConfigFile: false,
babelOptions: {
babelrc: false,
configFile: false,
},
},
env: {
browser: true,
es6: true,
},
};
26 changes: 26 additions & 0 deletions .github/workflows/javascript.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This workflow will run lints on the javascript version of tictactoe

name: javascript

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tictactoe_javascript
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Prettier
uses: actionsx/prettier@v2
with:
# prettier CLI arguments.
args: --check ./tictactoe_javascript
- name: Lint
run: eslint .
41 changes: 34 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,37 @@ repos:
# java specific
- repo: local
hooks:
- id: checkstyle
name: checkstyle
description: Check java style
entry: bash -c 'cd tictactoe_java && mvn checkstyle:check'
language: system
types: [java]
pass_filenames: false
- id: checkstyle
name: checkstyle
description: Check java style
entry: bash -c 'cd tictactoe_java && mvn checkstyle:check'
language: system
types: [java]
pass_filenames: false

# javascript specific
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.46.0
hooks:
- id: eslint
files: ^tictactoe_javascript/
args:
- --fix
additional_dependencies:
- eslint@8.46.0
- eslint-config-google@0.14.0
- "@babel/eslint-parser"
- eslint-config-prettier@9.0.0
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.1
hooks:
- id: prettier
types_or: [css, javascript]
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: htmlhint
- repo: https://github.com/pre-commit/mirrors-csslint
rev: v1.0.5
hooks:
- id: csslint
10 changes: 4 additions & 6 deletions tictactoe_javascript/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<!DOCTYPE html>
<html lang="en-us">

</html>

<head>
<!--
Tic Tac Toe with Minimax AI Algorithm
Expand Down Expand Up @@ -50,10 +48,10 @@ <h2 id="message">Select game mode</h2>
<div id="selectDiv">
<label for="difficulty">Choose an AI difficulty:</label>
<select name="difficulty" id="difficulty" onchange="handleSelectChange(event)">
<option value=1 class="difficultyOption">Easy</option>
<option value=2 class="difficultyOption">Medium</option>
<option value=3 class="difficultyOption">Hard</option>
<option value=4 class="difficultyOption" selected="selected">Impossible</option>
<option value="1" class="difficultyOption">Easy</option>
<option value="2" class="difficultyOption">Medium</option>
<option value="3" class="difficultyOption">Hard</option>
<option value="4" class="difficultyOption" selected="selected">Impossible</option>
</select>
</div>
</body>
Expand Down
Loading

0 comments on commit e234150

Please sign in to comment.