@tsrx/prettier-plugin 0.3.46 → 0.3.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/index.js +0 -20
- package/src/index.test.js +0 -39
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsrx/prettier-plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.47",
|
|
4
4
|
"description": "Ripple plugin for Prettier",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^24.3.0",
|
|
28
28
|
"prettier": "^3.8.3",
|
|
29
|
-
"ripple": "0.3.
|
|
29
|
+
"ripple": "0.3.47"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@tsrx/core": "0.0.
|
|
33
|
-
"@tsrx/ripple": "0.0.
|
|
32
|
+
"@tsrx/core": "0.0.27",
|
|
33
|
+
"@tsrx/ripple": "0.0.29"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"src/"
|
package/src/index.js
CHANGED
|
@@ -3903,7 +3903,6 @@ function printPropertyDefinition(node, path, options, print) {
|
|
|
3903
3903
|
function printMethodDefinition(node, path, options, print) {
|
|
3904
3904
|
/** @type {Doc[]} */
|
|
3905
3905
|
const parts = [];
|
|
3906
|
-
const is_component = /** @type {AST.TSRXMethodDefinition} */ (node).value?.type === 'Component';
|
|
3907
3906
|
|
|
3908
3907
|
// Access modifiers (public, private, protected)
|
|
3909
3908
|
if (node.accessibility) {
|
|
@@ -3934,16 +3933,6 @@ function printMethodDefinition(node, path, options, print) {
|
|
|
3934
3933
|
parts.push('*');
|
|
3935
3934
|
}
|
|
3936
3935
|
|
|
3937
|
-
if (is_component) {
|
|
3938
|
-
if (node.value.id) {
|
|
3939
|
-
// takes care of component methods
|
|
3940
|
-
parts.push(path.call(print, 'value'));
|
|
3941
|
-
return parts;
|
|
3942
|
-
}
|
|
3943
|
-
|
|
3944
|
-
parts.push('component ');
|
|
3945
|
-
}
|
|
3946
|
-
|
|
3947
3936
|
// the key is 'constructor' and we already handled that above
|
|
3948
3937
|
parts.push(...printKey(node, path, options, print));
|
|
3949
3938
|
|
|
@@ -3957,15 +3946,6 @@ function printMethodDefinition(node, path, options, print) {
|
|
|
3957
3946
|
}
|
|
3958
3947
|
}
|
|
3959
3948
|
|
|
3960
|
-
if (is_component) {
|
|
3961
|
-
const componentDoc = path.call(
|
|
3962
|
-
(childPath) => print(childPath, { skipComponentLabel: true }),
|
|
3963
|
-
'value',
|
|
3964
|
-
);
|
|
3965
|
-
parts.push(componentDoc);
|
|
3966
|
-
return parts;
|
|
3967
|
-
}
|
|
3968
|
-
|
|
3969
3949
|
// Parameters - use proper path.map for TypeScript support
|
|
3970
3950
|
parts.push('(');
|
|
3971
3951
|
if (node.value && node.value.params && node.value.params.length > 0) {
|
package/src/index.test.js
CHANGED
|
@@ -1920,17 +1920,6 @@ files = [...(files ?? []), ...dt.files];`;
|
|
|
1920
1920
|
expect(result).toBeWithNewline(expected);
|
|
1921
1921
|
});
|
|
1922
1922
|
|
|
1923
|
-
it('should preserve class component method', async () => {
|
|
1924
|
-
const expected = `class TestClass {
|
|
1925
|
-
component something() {
|
|
1926
|
-
<div>{'Nested component'}</div>
|
|
1927
|
-
}
|
|
1928
|
-
}`;
|
|
1929
|
-
|
|
1930
|
-
const result = await format(expected, { singleQuote: true, printWidth: 100 });
|
|
1931
|
-
expect(result).toBeWithNewline(expected);
|
|
1932
|
-
});
|
|
1933
|
-
|
|
1934
1923
|
it('should preserve class computed method', async () => {
|
|
1935
1924
|
const expected = `class TestClass {
|
|
1936
1925
|
['something']() {
|
|
@@ -1942,17 +1931,6 @@ files = [...(files ?? []), ...dt.files];`;
|
|
|
1942
1931
|
expect(result).toBeWithNewline(expected);
|
|
1943
1932
|
});
|
|
1944
1933
|
|
|
1945
|
-
it('should preserve class computed component method', async () => {
|
|
1946
|
-
const expected = `class TestClass {
|
|
1947
|
-
component ['something']() {
|
|
1948
|
-
<div>{'Nested component'}</div>
|
|
1949
|
-
}
|
|
1950
|
-
}`;
|
|
1951
|
-
|
|
1952
|
-
const result = await format(expected, { singleQuote: true, printWidth: 100 });
|
|
1953
|
-
expect(result).toBeWithNewline(expected);
|
|
1954
|
-
});
|
|
1955
|
-
|
|
1956
1934
|
it('should preserve fragment shorthand in class methods', async () => {
|
|
1957
1935
|
const input = `class Foo {
|
|
1958
1936
|
bar() {
|
|
@@ -1987,23 +1965,6 @@ files = [...(files ?? []), ...dt.files];`;
|
|
|
1987
1965
|
expect(result).toBeWithNewline(expected);
|
|
1988
1966
|
});
|
|
1989
1967
|
|
|
1990
|
-
it('should format class with a literal component method', async () => {
|
|
1991
|
-
const input = `class TestClass {
|
|
1992
|
-
component 'something'() {
|
|
1993
|
-
<div>{'Nested component'}</div>
|
|
1994
|
-
}
|
|
1995
|
-
}`;
|
|
1996
|
-
|
|
1997
|
-
const expected = `class TestClass {
|
|
1998
|
-
component something() {
|
|
1999
|
-
<div>{'Nested component'}</div>
|
|
2000
|
-
}
|
|
2001
|
-
}`;
|
|
2002
|
-
|
|
2003
|
-
const result = await format(input, { singleQuote: true, printWidth: 100 });
|
|
2004
|
-
expect(result).toBeWithNewline(expected);
|
|
2005
|
-
});
|
|
2006
|
-
|
|
2007
1968
|
it('should preserve object component methods', async () => {
|
|
2008
1969
|
const expected = `const obj = {
|
|
2009
1970
|
component something() {
|