diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index 6b54e0b..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npx eslint src diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..9239c6c --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,35 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends("standard", "prettier"), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.commonjs, + ...globals.node, + ...globals.jasmine, + }, + + ecmaVersion: 12, + sourceType: "commonjs", + }, + + rules: { + "prettier/prettier": ["error"], + }, +}]; \ No newline at end of file diff --git a/src/advanced/strings-adv.js b/src/advanced/strings-adv.js index 1b1eb60..008c8bc 100644 --- a/src/advanced/strings-adv.js +++ b/src/advanced/strings-adv.js @@ -1,5 +1,8 @@ +/* eslint-disable no-unused-vars */ const city = 'New York' +/* eslint-disable no-unused-vars */ const cityStr = 'City' +/* eslint-disable no-unused-vars */ const shoppingList = 'apples, bananas, oranges, grapes' // TODO get the INDEX of the character where 'York' word is found in the city variable diff --git a/src/numbers.js b/src/numbers.js index ee37fa1..946d450 100644 --- a/src/numbers.js +++ b/src/numbers.js @@ -12,22 +12,22 @@ const numThree = 32 // NOT myAnswer = 336 // 1. Set this variable to numOne added to numTwo -const numOnePlusNumTwo = NaN +const numOnePlusNumTwo = numOne + numTwo // 2. Set this variable to numThree multiplied by numTwo -const numThreeTimesNumTwo = NaN +const numThreeTimesNumTwo = numThree * numTwo // 3. Set this variable to numThree divided by numOne -const numThreeDividedByNumOne = NaN +const numThreeDividedByNumOne = numThree / numOne // 4. Set this variable to numThree minus numOne -const numThreeMinusNumOne = NaN +const numThreeMinusNumOne = numThree - numOne // 5. Set this variable to the sum of numOne, numTwo and numThree -const sum = NaN +const sum = numOne + numTwo + numThree // 6. Set this variable to the sum of (numOne, numTwo, numThree) divided by numOne -const numBytes = NaN +const numBytes = (numOne + numTwo + numThree) / numOne // do not edit the exported object. module.exports = { diff --git a/src/strings.js b/src/strings.js index a846086..515f29c 100644 --- a/src/strings.js +++ b/src/strings.js @@ -13,16 +13,16 @@ const secondName = 'Smith' // NOT twoJanes = "JaneJane" // 1. Set this variable to firstName and secondName concatenated -const fullName = null +const fullName = firstName + ' ' + secondName // 2. Set this variable to the 10th character of the alphabet variable -const tenthCharacterOfAlphabet = null +const tenthCharacterOfAlphabet = alphabet.charAt(9) // 3. Set this variable by calling a method on the alphabet variable to transform it to lower case -const lowerCaseAlphabet = null +const lowerCaseAlphabet = alphabet.toLowerCase() // 4. Set this variable by using a property on the alphabet variable to get it's length -const numberOfLettersInAlphabet = null +const numberOfLettersInAlphabet = alphabet.length // do not edit the exported object. module.exports = {