-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Oppgraderer til eslint 9. Disse pakker/plugins blir fjerna som ein del av dette, fordi dei ikkje er kompatible med versjon 9, eller ikkje ser ut til å ha nytteverdi for oss: @typescript-eslint/eslint-plugin, @typescript-eslint/parser: Erstatta med typescript-eslint plugin. eslint-config-airbnb: Siste oppdatering var tre år sidan, og blir ikkje oppdatert med det første. eslint-plugin-import, eslint-import-resolver-typescript: Støtter ikkje versjon 9, og uvisst kor nyttig denne er for oss. Trur andre delar av build gjere nok sjekk på imports. eslint-plugin-jest-dom: Denne ser ikkje ut til å ha vore aktivert i gammal konfigurasjon. Fekk masse feil når den vart aktivert med recommended innstillinger, og fekk ikkje framprovosert feil i gammal konfigurasjon. eslint-plugin-storybook: Ikkje oppdatert til versjon 9, og ser ikkje ut til å ha vore aktivert i gammal konfigurasjon. Klarte ikkje framprovosere feil der ut frå anbefalt sjekk. Endre også tsconfig.json innstilling til react-jsx. Med dette slepp ein å importere React i alle filer som bruker jsx. Og unngår dermed eslint feil om unused-var frå importen av React. Den nye eslint.config.mjs prøver å forenkle i forhold til gammal konfigurasjon, den aktiverer i utgangspunktet recommended settings frå grunnkonfigurasjon og alle plugins, og så tilpasser den litt der det trengs for å unngå for mykje feil i eksisterande kodebase. Kan så skru denne meir strict etterkvart viss vi ser mulighet for det, feks for filer under packages/v2. * Diverse minimale endringer for kompatibilitet med eslint 9. Kun endringer i kommentarer og typescript/postcss konfigurasjon. Ingen endring i runtime javascript. * yarn.lock oppdatert etter fjerning av dayjs.
- Loading branch information
Showing
129 changed files
with
440 additions
and
1,014 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// @ts-check | ||
|
||
import eslint from '@eslint/js'; | ||
import configPrettier from 'eslint-config-prettier'; | ||
import globals from "globals"; | ||
import tseslint from 'typescript-eslint'; | ||
import pluginReact from 'eslint-plugin-react' | ||
import pluginJsxA11y from 'eslint-plugin-jsx-a11y'; | ||
import pluginVitest from 'eslint-plugin-vitest'; | ||
// Viss vi ønsker eslint-plugin-jest-dom aktivert: import pluginJestDom from 'eslint-plugin-jest-dom'; | ||
// ^- Rapporterer ein del feil, så virker ikkje å ha vore aktivert før. | ||
|
||
|
||
const OFF = 0; | ||
const WARN = 1; | ||
const ERROR = 2; | ||
|
||
const config = tseslint.config( | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
configPrettier, | ||
pluginReact.configs.flat['jsx-runtime'], | ||
pluginJsxA11y.flatConfigs.recommended, | ||
pluginVitest.configs.recommended, | ||
// Viss vi ønsker jest-dom plugin aktivert: pluginJestDom.configs["flat/recommended"], | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
}, | ||
}, | ||
linterOptions: { | ||
// Vurder å enable denne seinare | ||
reportUnusedDisableDirectives: false | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': OFF, | ||
'@typescript-eslint/no-unused-vars': [ | ||
"error", | ||
{ | ||
varsIgnorePattern: "React" // TODO Fjern denne og samtidig alle ubrukte React imports. Unødvendig etter overgang til react-jsx i tsconfig | ||
} | ||
], | ||
'jsx-a11y/no-autofocus': OFF, // Skrudd av ved migrering til jsx-a11y recommended config. Vurder å fikse seinare. | ||
'jsx-a11y/anchor-is-valid': OFF, | ||
} | ||
}, | ||
{ | ||
files: ["**/*.cjs"], | ||
rules: { | ||
'@typescript-eslint/no-var-requires': OFF, | ||
}, | ||
languageOptions: { | ||
globals: { | ||
require: true, | ||
module: true, | ||
} | ||
} | ||
}, | ||
{ | ||
files: ["packages/v2/**.*.ts", "packages/v2/**.*.tsx"], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': ERROR | ||
} | ||
}, | ||
{ | ||
files: ["**/KroniskSykObjektTilMikrofrontend.ts"], | ||
rules: { | ||
'no-constant-binary-expression': OFF // TODO Fiks denne, sannsynlegvis bug | ||
} | ||
} | ||
) | ||
|
||
export default config |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
packages/fakta-arbeidsforhold/src/ArbeidsforholdFaktaIndex.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export { default as EtablertTilsyn } from './src/ui/MainComponent'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export { default as Inntektsmelding } from './src/ui/MainComponent'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.