chore: Migrate from next lint to eslint * Migrate scandic-web * Migrate partner-sas * Enable any rule in partner-sas Approved-by: Joakim Jäderberg Approved-by: Linus Flood
19 lines
482 B
JavaScript
19 lines
482 B
JavaScript
import path from "node:path"
|
|
|
|
const WEB_ROOT = path.join(process.cwd(), "apps/scandic-web/")
|
|
|
|
const buildEslintCommand = (filenames) => {
|
|
const files = filenames
|
|
.map((f) => `'${path.relative(WEB_ROOT, f)}'`)
|
|
.join(" ")
|
|
return `eslint --fix --no-warn-ignored --max-warnings 0 ${files}`
|
|
}
|
|
|
|
const config = {
|
|
"*.{js,jsx,ts,tsx}": [buildEslintCommand],
|
|
"*.{ts,tsx}": () => "yarn check-types",
|
|
"*.{js,jsx,ts,tsx,json,css}": "prettier --write",
|
|
}
|
|
|
|
export default config
|