File tree 2 files changed +43
-1
lines changed
2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ const baseExtend =
6
6
export = {
7
7
extends : [ baseExtend ] ,
8
8
rules : Object . fromEntries (
9
- rules . map ( ( rule ) => [ `svelte/${ rule . meta . docs . ruleName } ` , "error" ] ) ,
9
+ rules
10
+ . map ( ( rule ) => [ `svelte/${ rule . meta . docs . ruleName } ` , "error" ] )
11
+ . filter (
12
+ ( [ ruleName ] ) =>
13
+ ! [
14
+ // Does not work without options.
15
+ "svelte/no-restricted-html-elements" ,
16
+ ] . includes ( ruleName ) ,
17
+ ) ,
10
18
) ,
11
19
}
Original file line number Diff line number Diff line change
1
+ import assert from "assert"
2
+ import eslint from "eslint"
3
+ import plugin from "../../../src/index"
4
+
5
+ describe ( "`all` config" , ( ) => {
6
+ it ( "`all` config should work. " , async ( ) => {
7
+ const code = `<script>const a = 1, b = 2;</script>{@html a+b}`
8
+
9
+ const linter = new eslint . ESLint ( {
10
+ plugins : {
11
+ svelte : plugin as never ,
12
+ } ,
13
+ baseConfig : {
14
+ parserOptions : {
15
+ ecmaVersion : "latest" ,
16
+ } ,
17
+ extends : [ "plugin:svelte/all" ] ,
18
+ } ,
19
+ useEslintrc : false ,
20
+ } )
21
+ const result = await linter . lintText ( code , { filePath : "test.svelte" } )
22
+ const messages = result [ 0 ] . messages
23
+
24
+ assert . deepStrictEqual (
25
+ messages . map ( ( m ) => ( { ruleId : m . ruleId , line : m . line } ) ) ,
26
+ [
27
+ {
28
+ ruleId : "svelte/no-at-html-tags" ,
29
+ line : 1 ,
30
+ } ,
31
+ ] ,
32
+ )
33
+ } )
34
+ } )
You can’t perform that action at this time.
0 commit comments