1- import type { RuleContext , Rule } from "../types" ;
1+ import type { RuleContext , RuleListener } from "../types" ;
22import type { VCSSParsingError } from "../styles/ast" ;
33import type { InvalidStyleContext } from "../styles/context" ;
44import {
55 getStyleContexts ,
66 getCommentDirectivesReporter ,
77} from "../styles/context" ;
88
9- declare const module : {
10- exports : Rule ;
11- } ;
12-
13- module . exports = {
9+ export = {
1410 meta : {
1511 docs : {
1612 description : "disallow parsing errors in `<style>`" ,
@@ -19,11 +15,11 @@ module.exports = {
1915 url : "https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-parsing-error.html" ,
2016 } ,
2117 fixable : null ,
22- messages : { } ,
18+ messages : { parsingError : "Parsing error: {{message}}." } ,
2319 schema : [ ] ,
2420 type : "problem" ,
2521 } ,
26- create ( context : RuleContext ) {
22+ create ( context : RuleContext ) : RuleListener {
2723 const styles = getStyleContexts ( context ) ;
2824 if ( ! styles . length ) {
2925 return { } ;
@@ -38,7 +34,7 @@ module.exports = {
3834 reporter . report ( {
3935 node,
4036 loc : node . loc . start ,
41- message : "Parsing error: {{message}}. " ,
37+ messageId : "parsingError " ,
4238 data : {
4339 message : node . message . endsWith ( "." )
4440 ? node . message . slice ( 0 , - 1 )
@@ -55,7 +51,7 @@ module.exports = {
5551 reporter . report ( {
5652 node : style . styleElement ,
5753 loc : style . invalid . loc ,
58- message : "Parsing error: {{message}}. " ,
54+ messageId : "parsingError " ,
5955 data : {
6056 message : style . invalid . message ,
6157 } ,
0 commit comments