intial
This commit is contained in:
7
node_modules/eslint-plugin-svelte/lib/processor/index.d.ts
generated
vendored
Normal file
7
node_modules/eslint-plugin-svelte/lib/processor/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Linter } from 'eslint';
|
||||
export * as meta from '../meta.js';
|
||||
/** preprocess */
|
||||
export declare function preprocess(code: string, filename: string): string[];
|
||||
/** postprocess */
|
||||
export declare function postprocess([messages]: Linter.LintMessage[][], filename: string): Linter.LintMessage[];
|
||||
export declare const supportsAutofix = true;
|
||||
29
node_modules/eslint-plugin-svelte/lib/processor/index.js
generated
vendored
Normal file
29
node_modules/eslint-plugin-svelte/lib/processor/index.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { beginShared, terminateShared } from '../shared/index.js';
|
||||
export * as meta from '../meta.js';
|
||||
/** preprocess */
|
||||
export function preprocess(code, filename) {
|
||||
if (filename) {
|
||||
beginShared(filename);
|
||||
}
|
||||
return [code];
|
||||
}
|
||||
/** postprocess */
|
||||
export function postprocess([messages], filename) {
|
||||
const shared = terminateShared(filename);
|
||||
if (shared) {
|
||||
return filter(messages, shared);
|
||||
}
|
||||
return messages;
|
||||
}
|
||||
export const supportsAutofix = true;
|
||||
/** Filter */
|
||||
function filter(messages, shared) {
|
||||
if (shared.commentDirectives.length === 0) {
|
||||
return messages;
|
||||
}
|
||||
let filteredMessages = messages;
|
||||
for (const cd of shared.commentDirectives) {
|
||||
filteredMessages = cd.filterMessages(filteredMessages);
|
||||
}
|
||||
return filteredMessages;
|
||||
}
|
||||
Reference in New Issue
Block a user