From a3edb28960cae74b5f341d1c8a4e7ad5ff1af1bc Mon Sep 17 00:00:00 2001 From: skedwards88 Date: Wed, 7 Feb 2024 07:20:09 -0800 Subject: [PATCH 1/2] add linting workflow, fix linting errors --- .eslintrc.js | 5 +++++ .github/workflows/lint.yml | 26 ++++++++++++++++++++++++++ src/App.css | 12 +++++------- src/components/Rules.js | 4 +--- src/logic/gameReducer.js | 2 +- 5 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.eslintrc.js b/.eslintrc.js index ff91934..9c9ab4a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,4 +16,9 @@ module.exports = { rules: { "react/prop-types": "off", }, + settings: { + react: { + version: "detect", + }, + }, }; diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..8151dac --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,26 @@ +name: Lint + +on: + pull_request: + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install requirements + run: npm ci + + - name: Prettier + run: npx prettier -c src/ README.md .github/workflows + + - name: ES lint + run: npx eslint --ignore-path .gitignore . + + - name: Stylelint + run: npx stylelint '**/*.css' diff --git a/src/App.css b/src/App.css index 26b0f74..159c564 100644 --- a/src/App.css +++ b/src/App.css @@ -1,6 +1,7 @@ html { height: 100%; background-color: var(--dark-color); + --default-font-size: min(4vmax, 7vmin, 40px); --dark-color: rgb(55 54 71); --light-color: rgb(239 239 239); @@ -315,11 +316,8 @@ input[type="checkbox" i]:checked { /* Landscape */ @media (orientation: landscape) { #gribbles { - grid-template-areas: - "stats currentWord controls" - "foundWords board controls"; - grid-template-rows: auto 1fr; - grid-template-columns: 1fr auto auto; + grid-template: + "stats currentWord controls" auto "foundWords board controls" 1fr / 1fr auto auto; } #controls { @@ -338,7 +336,7 @@ input[type="checkbox" i]:checked { } /* Large screen */ -@media (min-height: 600px) and (min-width: 600px) { +@media (height >= 600px) and (width >= 600px) { #board { align-items: center; align-self: center; @@ -363,4 +361,4 @@ input[type="checkbox" i]:checked { #setting-buttons { width: fit-content; } -} \ No newline at end of file +} diff --git a/src/components/Rules.js b/src/components/Rules.js index c875a77..4cded5c 100644 --- a/src/components/Rules.js +++ b/src/components/Rules.js @@ -6,9 +6,7 @@ export default function Rules({setDisplay, timerDispatch}) {

Gribbles: How to play

- { - `Swipe to connect letters into words.\n\nCan you find all the words before time is up?\n\nChange the settings to control how much time you start with and how much time you get for each word that you find.\n\nIn easy mode, get a bonus point for less common words.` - } + {`Swipe to connect letters into words.\n\nCan you find all the words before time is up?\n\nChange the settings to control how much time you start with and how much time you get for each word that you find.\n\nIn easy mode, get a bonus point for less common words.`}