From b6ac23b8dacee33287bd2e8657c7b152520c41f0 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Wed, 23 Aug 2023 21:50:25 +0100 Subject: [PATCH] Enable ESLint typed code style guidance --- packages/govuk-frontend/.eslintrc.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/packages/govuk-frontend/.eslintrc.js b/packages/govuk-frontend/.eslintrc.js index c8aa228c5f..7eef9bb978 100644 --- a/packages/govuk-frontend/.eslintrc.js +++ b/packages/govuk-frontend/.eslintrc.js @@ -1,4 +1,4 @@ -const { resolve } = require('path') +const { join } = require('path') module.exports = { settings: { @@ -14,12 +14,12 @@ module.exports = { parserOptions: { // Note: Allow ES2015 for import/export syntax ecmaVersion: '2015', - project: [resolve(__dirname, 'tsconfig.dev.json')] + project: [join(__dirname, 'tsconfig.build.json')] }, plugins: ['@typescript-eslint', 'es-x'], extends: [ - 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'plugin:@typescript-eslint/strict-type-checked', + 'plugin:@typescript-eslint/stylistic-type-checked', 'plugin:es-x/restrict-to-es2015', 'prettier' ], @@ -27,15 +27,6 @@ module.exports = { browser: true }, rules: { - // Check type support for template string implicit `.toString()` - '@typescript-eslint/restrict-template-expressions': [ - 'error', - { - allowBoolean: true, - allowNumber: true - } - ], - // Babel transpiles ES2020 class fields 'es-x/no-class-fields': 'off',