Skip to content

Commit

Permalink
Merge pull request #3334 from mathesar-foundation/eslint-plugin-svelte
Browse files Browse the repository at this point in the history
Replace eslint-plugin-svelte3 with officially supported eslint-plugin-svelte plugin
  • Loading branch information
seancolsen authored Dec 6, 2023
2 parents 7c39f5f + dd18b5e commit bea549a
Show file tree
Hide file tree
Showing 30 changed files with 347 additions and 199 deletions.
27 changes: 19 additions & 8 deletions mathesar_ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
const typescript = require('typescript');

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
ignorePatterns: ['node_modules', 'dist', 'index.html'],
ignorePatterns: [
'node_modules',
'dist',
'index.html',
'src/**/*.stories.svelte',
],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
extraFileExtensions: ['.svelte', '.cjs', '.json'],
extraFileExtensions: ['.svelte', '.json'],
},
plugins: ['svelte3', '@typescript-eslint'],
plugins: ['@typescript-eslint'],
extends: [
'airbnb-base',
'airbnb-typescript/base',
'plugin:eslint-comments/recommended',
'plugin:promise/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:svelte/recommended',
'plugin:svelte/prettier',
],
rules: {
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
Expand All @@ -43,7 +48,10 @@ module.exports = {
overrides: [
{
files: ['*.svelte'],
processor: 'svelte3/svelte3',
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
rules: {
'import/first': 'off',
'import/no-duplicates': 'off',
Expand Down Expand Up @@ -76,6 +84,10 @@ module.exports = {
'@typescript-eslint/no-unsafe-argument': 'off',
'no-sequences': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ varsIgnorePattern: '^\\$\\$(Props|Events|Slots)$' },
],
},
},
{
Expand Down Expand Up @@ -146,10 +158,9 @@ module.exports = {
},
globals: {
vi: true,
$$Generic: 'readonly',
},
settings: {
'svelte3/typescript': () => typescript,
'svelte3/ignore-styles': ({ lang }) => lang === 'scss',
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
Expand Down
Loading

0 comments on commit bea549a

Please sign in to comment.