0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-21 19:38:58 +01:00
svelte/eslint.config.js
Rich Harris 73490bbb8e
chore: markdown errors (#11294)
* rename errors.js to errors-tmp.js

* start porting errors

* generate markdown files for more errors

* convert parse errors

* convert css errors

* convert special_element errors

* convert runes errors

* convert element errors

* more

* more

* more

* more

* more

* more

* fix some tests

* fix some tests

* more tests

* remove unused error

* prettierignore

* weird

* ugh

* lint
2024-04-23 10:39:37 -04:00

49 lines
1.3 KiB
JavaScript

import svelte_config from '@sveltejs/eslint-config';
import lube from 'eslint-plugin-lube';
/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
...svelte_config,
{
plugins: {
lube
},
rules: {
'no-console': 'error',
'lube/svelte-naming-convention': ['error', { fixSameNames: true }],
// eslint isn't that well-versed with JSDoc to know that `foo: /** @type{..} */ (foo)` isn't a violation of this rule, so turn it off
'object-shorthand': 'off',
'no-var': 'off',
// TODO: enable these rules and run `pnpm lint:fix`
// skipping that for now so as to avoid impacting real work
'@stylistic/quotes': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'prefer-const': 'off'
}
},
{
files: ['playgrounds/**/*'],
rules: {
'lube/svelte-naming-convention': 'off',
'no-console': 'off'
}
},
{
ignores: [
'**/*.d.ts',
'**/tests',
'packages/svelte/scripts/process-messages/templates/*.js',
'packages/svelte/src/compiler/errors.js',
'packages/svelte/compiler/index.js',
// documentation can contain invalid examples
'documentation',
// contains a fork of the REPL which doesn't adhere to eslint rules
'sites/svelte-5-preview/**',
// wasn't checked previously, reenable at some point
'sites/svelte.dev/**',
'tmp/**'
]
}
];