diff --git a/eslint.config.cjs b/eslint.config.cjs new file mode 100644 index 0000000..fae6b58 --- /dev/null +++ b/eslint.config.cjs @@ -0,0 +1,50 @@ +/** @type { import("eslint").Linter.Config } */ +module.exports = { + files: ['**/*.js', '**/*.ts', '**/*.svelte'], + languageOptions: { + ecmaVersion: 2022, + sourceType: 'module', + extraFileExtensions: ['.svelte'] + }, + environments: { + browser: true, + es2021: true, + node: true + }, + globals: {}, + parser: '@typescript-eslint/parser', + processor: 'svelte-eslint-parser', + linterOptions: { + reportUnusedDisableDirectives: 'error' + }, + rules: { + 'import/export': 'error', + 'import/no-empty-named-blocks': 'error', + 'import/no-absolute-path': 'error', + 'import/no-self-import': 'error', + 'import/no-useless-path-segments': 'error', + 'import/newline-after-import': 'error', + 'import/no-duplicates': 'error', + 'import/order': 'error', + 'no-undef': 'off' + }, + settings: { + 'svelte/typescript': function () { + return require('typescript'); + }, + 'import/extensions': ['.js', '.ts', '.svelte', '.stories.ts'], + 'import/resolver': { + typescript: { + alwaysTryTypes: true + } + } + }, + overrides: [ + { + files: ['*.svelte'], + languageOptions: { + parser: '@typescript-eslint/parser' + } + } + ] +}; diff --git a/src/lib/component/Icon.svelte b/src/lib/component/Icon.svelte index 8d56172..2325b8b 100644 --- a/src/lib/component/Icon.svelte +++ b/src/lib/component/Icon.svelte @@ -1,6 +1,6 @@