Skip to content

Commit

Permalink
update eslint stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
tjheffner committed Mar 19, 2024
1 parent 0510232 commit 5a896b4
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 687 deletions.
29 changes: 14 additions & 15 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
// 'plugin:@typescript-eslint/recommended', // todo: https://stackoverflow.com/questions/57597142/how-to-run-typescript-eslint-on-ts-files-and-eslint-on-js-files-in-the-same-pr
'prettier',
],
plugins: ['svelte3', '@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:svelte/recommended', 'prettier'],
plugins: ['@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript'),
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
// Parse the `<script>` in `.svelte` as TypeScript by adding the following configuration.
parserOptions: {
parser: '@typescript-eslint/parser',
},
},
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2019,
},
rules: {
'no-unused-expressions': 'warn',
'no-constant-binary-expression': 'warn',
'no-sequences': 'warn',
project: './tsconfig.json',
extraFileExtensions: ['.svelte'], // This is a required setting in `@typescript-eslint/parser` v4.24.0.
},
env: {
browser: true,
Expand Down
Loading

0 comments on commit 5a896b4

Please sign in to comment.