Skip to content

Commit

Permalink
chore: self code review tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kswenson committed Dec 9, 2024
1 parent a95eadc commit aa6d04f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions v3/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import globals from "globals"
import path from "node:path"
import { fileURLToPath } from "node:url"

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
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 [{
ignores: ["**/dist/", "**/node_modules/", "src/models/formula/lezer"],
Expand Down Expand Up @@ -78,7 +78,7 @@ export default [{
"@stylistic/block-spacing": ["off"],
"@stylistic/comma-spacing": ["warn"],
"@stylistic/eol-last": ["warn"],
"@stylistic/func-call-spacing": ["warn"],
"@stylistic/function-call-spacing": ["warn"],
"@stylistic/keyword-spacing": ["warn"],
"@stylistic/max-len": ["warn", { code: 120, ignoreUrls: true }],
"@stylistic/no-tabs": "error",
Expand Down
4 changes: 2 additions & 2 deletions v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"build:webpack": "webpack --mode production",
"clean:cache": "rimraf .cache",
"lezer:generate": "lezer-generator src/models/formula/lezer/formula.grammar -o src/models/formula/lezer/parser.js",
"lint": "eslint --cache --cache-location \".cache/eslint/default\" \"./src/**/*.{js,jsx,ts,tsx}\" \"./cypress/**/*.{js,jsx,ts,tsx}\"",
"lint:build": "eslint --cache --cache-strategy content --cache-location \".cache/eslint/build\" -c \"eslint.build.config.mjs\" \"./src/**/*.{js,jsx,ts,tsx}\" \"./cypress/**/*.{js,jsx,ts,tsx}\"",
"lint": "eslint --cache --cache-strategy content --cache-location \".cache/eslint/default\" -c \"eslint.config.mjs\" \"./src/**/*.{js,jsx,mjs,ts,tsx}\" \"./cypress/**/*.{js,jsx,ts,tsx}\"",
"lint:build": "eslint --cache --cache-strategy content --cache-location \".cache/eslint/build\" -c \"eslint.build.config.mjs\" \"./src/**/*.{js,jsx,mjs,ts,tsx}\" \"./cypress/**/*.{js,jsx,mjs,ts,tsx}\"",
"lint:fix": "eslint --cache --fix \"./src/**/*.{js,jsx,ts,tsx}\" \"./cypress/**/*.{js,jsx,ts,tsx}\"",
"lint:style": "eslint -c \".eslintrc.style.cjs\" \"./src/**/*.{js,jsx,ts,tsx}\" \"./cypress/**/*.{js,jsx,ts,tsx}\"",
"lint:style:fix": "eslint -c \".eslintrc.style.cjs\" \"./src/**/*.{js,jsx,ts,tsx}\" \"./cypress/**/*.{js,jsx,ts,tsx}\"",
Expand Down
5 changes: 3 additions & 2 deletions v3/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
},
"include": [
"src/**/*",
".eslintrc*.cjs",
"eslint.*.mjs",
// cypress.config.ts will need another pass before being added
// "*.config.ts",
"*.config.js",
"why-did-you-render.ts"
],
"exclude": [
"src/**/*.v2.ts",
"*.grammar"
"*.grammar",
"*.json"
]
}
2 changes: 2 additions & 0 deletions v3/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ module.exports = (env, argv) => {
// so we don't need to run it again as part of the webpack build
webpackPlugins.push(new ESLintPlugin({
cacheLocation: path.resolve(__dirname, `${CACHE_DIRECTORY}/eslint-webpack-plugin/.eslintcache`),
configType: 'flat',
extensions: ['ts', 'tsx', 'js', 'jsx'],
lintDirtyModulesOnly: true
}))
}
if (!process.env.CODE_COVERAGE) {
Expand Down

0 comments on commit aa6d04f

Please sign in to comment.