-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathall.ts
34 lines (31 loc) · 789 Bytes
/
all.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import assert from 'assert';
import plugin from '../../../src/index';
import { LegacyESLint } from '../../utils/eslint-compat';
describe('`all` config', () => {
it('`all` config should work. ', async () => {
const code = `<script>const a = 1, b = 2;</script>{@html a+b}`;
const linter = new LegacyESLint({
plugins: {
svelte: plugin as never
},
baseConfig: {
parserOptions: {
ecmaVersion: 2020
},
extends: ['plugin:svelte/all']
},
useEslintrc: false
});
const result = await linter.lintText(code, { filePath: 'test.svelte' });
const messages = result[0].messages;
assert.deepStrictEqual(
messages.map((m) => ({ ruleId: m.ruleId, line: m.line })),
[
{
ruleId: 'svelte/no-at-html-tags',
line: 1
}
]
);
});
});