Skip to content

Commit aeb512e

Browse files
committed
refactor(prettier): remove sort-lit-get-properties plugin
The property sorting logic has been migrated to an ESLint rule. Remove the Prettier plugin, its test, and simplify the config.
1 parent f3ee4ec commit aeb512e

File tree

3 files changed

+1
-273
lines changed

3 files changed

+1
-273
lines changed

prettier-rules/sort-lit-get-properties.js

Lines changed: 0 additions & 112 deletions
This file was deleted.

prettier.config.js

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
1-
// @ts-expect-error
2-
import pluginSortImports from 'prettier-plugin-organize-imports';
3-
import sortGetPropsPlugin from './prettier-rules/sort-lit-get-properties.js';
4-
5-
// When there are multiple Prettier plugins, there can be conflicts when both try to use the same language parser.
6-
// This occurs because when a language parser is re-assigned, handlers from previous plugins get lost.
7-
// Below we merge the babel parser handling of both plugins to avoid overwriting each other.
8-
// We need this hack until Prettier does something about it.
9-
// Issue: https://github.com/prettier/prettier/issues/12807
10-
/** @type {import("prettier").Parser} */
11-
const babelParser = {
12-
...pluginSortImports.parsers.babel,
13-
parse: sortGetPropsPlugin.parsers.babel.parse,
14-
};
15-
16-
/** @type {import("prettier").Parser} */
17-
const typescriptParser = {
18-
...pluginSortImports.parsers.typescript,
19-
};
20-
21-
/** @type {import("prettier").Plugin} */
22-
const myPlugin = {
23-
parsers: {
24-
babel: babelParser,
25-
typescript: typescriptParser,
26-
},
27-
};
28-
291
export default {
30-
plugins: [myPlugin],
2+
plugins: ['prettier-plugin-organize-imports'],
313
arrowParens: 'always',
324
printWidth: 120,
335
tabWidth: 2,

test-mocha/prettier/sort-lit-get-properties.test.js

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)