Skip to content

Commit

Permalink
Enable ESLint typed code style guidance
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Sep 13, 2023
1 parent 260b434 commit b6ac23b
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions packages/govuk-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { resolve } = require('path')
const { join } = require('path')

module.exports = {
settings: {
Expand All @@ -14,28 +14,19 @@ 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'
],
env: {
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',

Expand Down

0 comments on commit b6ac23b

Please sign in to comment.