Skip to content

Commit

Permalink
moving isPrettier2 to the backwards compatibility module
Browse files Browse the repository at this point in the history
  • Loading branch information
Janther committed Oct 31, 2023
1 parent ce38d20 commit 0a84cc2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/common/backward-compatibility.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { util } from 'prettier';
import { isPrettier2 } from './util.js';
import { prettierVersionSatisfies } from './util.js';

export const isPrettier2 = () => prettierVersionSatisfies('^2.3.0');

// The functions in this file will never be 100% covered in a single run
// since it depends on the version of Prettier being used.
Expand Down
2 changes: 1 addition & 1 deletion src/common/printer-helpers.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { doc } from 'prettier';
import { isPrettier2 } from './util.js';
import {
isFirst,
isLast,
isNextLineEmpty,
isPrettier2,
next,
previous
} from './backward-compatibility.js';
Expand Down
1 change: 0 additions & 1 deletion src/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { util, version } from 'prettier';
import satisfies from 'semver/functions/satisfies.js';

export const prettierVersionSatisfies = (range) => satisfies(version, range);
export const isPrettier2 = () => prettierVersionSatisfies('^2.3.0');

export function printString(rawContent, options) {
const double = { quote: '"', regex: /"/g };
Expand Down

0 comments on commit 0a84cc2

Please sign in to comment.