mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
fix: exports of eslint-plugin-prettier changed (#43817)
This commit is contained in:
parent
f5ad8554cd
commit
ebd96572dd
@ -1,28 +1,4 @@
|
||||
import * as utils from 'eslint-plugin-prettier';
|
||||
import { configs, rules } from 'eslint-plugin-prettier';
|
||||
|
||||
declare function log(...args: Array<string | number>): void;
|
||||
|
||||
utils.showInvisibles(' some string ');
|
||||
|
||||
utils.generateDifferences('abc', 'def').forEach(difference => {
|
||||
const {
|
||||
operation,
|
||||
offset,
|
||||
deleteText = '',
|
||||
insertText = '',
|
||||
} = difference;
|
||||
|
||||
switch (operation) {
|
||||
case 'delete':
|
||||
log('delete', offset, deleteText);
|
||||
break;
|
||||
case 'insert':
|
||||
log('insert', offset, insertText);
|
||||
break;
|
||||
case 'replace':
|
||||
log('replace', offset, insertText, deleteText);
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unexpected operation: '${operation}'`);
|
||||
}
|
||||
});
|
||||
configs.recommended;
|
||||
rules.prettier;
|
||||
|
||||
32
types/eslint-plugin-prettier/index.d.ts
vendored
32
types/eslint-plugin-prettier/index.d.ts
vendored
@ -1,29 +1,15 @@
|
||||
// Type definitions for eslint-plugin-prettier 2.2
|
||||
// Type definitions for eslint-plugin-prettier 3.1
|
||||
// Project: https://github.com/prettier/eslint-plugin-prettier
|
||||
// Definitions by: Ika <https://github.com/ikatyang>
|
||||
// JounQin <https://github.com/JounQin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Converts invisible characters to a commonly recognizable visible form.
|
||||
* @param str The string with invisibles to convert.
|
||||
*/
|
||||
export function showInvisibles(str: string): string;
|
||||
import { Linter, Rule } from 'eslint';
|
||||
|
||||
/**
|
||||
* Generate results for differences between source code and formatted version.
|
||||
* @param source The original source.
|
||||
* @param formatted The formatted source.
|
||||
*/
|
||||
export function generateDifferences(
|
||||
source: string,
|
||||
formatted: string,
|
||||
): Difference[];
|
||||
export const configs: {
|
||||
recommended: Linter.Config;
|
||||
};
|
||||
|
||||
export interface Difference {
|
||||
operation: 'insert' | 'delete' | 'replace';
|
||||
offset: number;
|
||||
insertText?: string;
|
||||
deleteText?: string;
|
||||
}
|
||||
|
||||
export const rules: any;
|
||||
export const rules: {
|
||||
prettier: Rule.RuleModule;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user