Skip to content

Commit db2a77d

Browse files
authored
chore: update dependencies (prettier#321)
1 parent 6f44f5f commit db2a77d

15 files changed

+1373
-3479
lines changed

.github/renovate.json5

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
3+
dependencyDashboardApproval: true,
34
postUpdateOptions: ['yarnDedupeHighest'],
45
}

.github/workflows/autofix.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: autofix.ci # needed to securely identify the workflow
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
fix:
12+
name: Run automated fix
13+
uses: prettier/shared-workflows/.github/workflows/automated-fix.yml@main
14+
permissions: {}
15+
with:
16+
repository: prettier/prettier

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ jobs:
3333
node:
3434
- '22'
3535
- '20'
36-
- '18'
37-
- '16'
3836
name: Node.js ${{ matrix.node }}
3937
runs-on: ubuntu-latest
4038
steps:
@@ -47,7 +45,9 @@ jobs:
4745
- run: yarn run test
4846
env:
4947
ENABLE_COVERAGE: 1
50-
- uses: codecov/codecov-action@v4
48+
- uses: codecov/codecov-action@v5
5149
with:
52-
token: ${{ secrets.CODECOV_TOKEN }}
5350
fail_ci_if_error: true
51+
disable_search: true
52+
files: coverage/lcov.info
53+
token: ${{ secrets.CODECOV_TOKEN }}

eslint.config.js

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import eslintPluginJs from '@eslint/js';
22
import eslintConfigPrettier from 'eslint-config-prettier';
3-
import eslintPluginImport from 'eslint-plugin-import';
43
import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
54
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
65
import globals from 'globals';
@@ -17,12 +16,10 @@ export default tseslint.config(
1716
},
1817
plugins: {
1918
'simple-import-sort': eslintPluginSimpleImportSort,
20-
import: eslintPluginImport,
2119
unicorn: eslintPluginUnicorn,
2220
},
2321
rules: {
2422
'no-constant-condition': ['error', { checkLoops: false }],
25-
'import/extensions': ['error', 'always'],
2623
'simple-import-sort/imports': 'error',
2724
'simple-import-sort/exports': 'error',
2825
'unicorn/prefer-at': 'error',

jest.config.js

-30
This file was deleted.

package.json

+16-17
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"scripts": {
1717
"clean": "del-cli ./lib",
1818
"prepare": "yarn run build",
19-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
19+
"test": "vitest",
2020
"lint": "run-p \"lint:*\"",
2121
"lint:eslint": "eslint",
2222
"lint:prettier": "prettier --check .",
@@ -27,28 +27,27 @@
2727
"release": "yarn build && standard-version"
2828
},
2929
"devDependencies": {
30-
"@angular/compiler": "19.0.0",
30+
"@angular/compiler": "19.2.1",
3131
"@babel/code-frame": "7.26.2",
32-
"@babel/parser": "7.26.2",
33-
"@babel/types": "7.26.0",
32+
"@babel/parser": "7.26.9",
33+
"@babel/types": "7.26.9",
3434
"@types/babel__code-frame": "7.0.6",
35-
"@types/jest": "29.5.14",
35+
"@types/node": "22.13.10",
36+
"@vitest/coverage-v8": "3.0.8",
3637
"del-cli": "6.0.0",
37-
"eslint": "9.15.0",
38-
"eslint-config-prettier": "9.1.0",
39-
"eslint-plugin-import": "2.31.0",
38+
"eslint": "9.22.0",
39+
"eslint-config-prettier": "10.1.1",
4040
"eslint-plugin-simple-import-sort": "12.1.1",
41-
"eslint-plugin-unicorn": "56.0.1",
42-
"globals": "15.12.0",
43-
"jest": "29.7.0",
44-
"jest-snapshot-serializer-raw": "1.2.0",
41+
"eslint-plugin-unicorn": "57.0.0",
42+
"globals": "16.0.0",
43+
"jest-snapshot-serializer-raw": "2.0.0",
4544
"lines-and-columns": "2.0.4",
46-
"npm-run-all": "4.1.5",
47-
"prettier": "3.3.3",
45+
"npm-run-all2": "7.0.2",
46+
"prettier": "3.5.3",
4847
"standard-version": "9.5.0",
49-
"ts-jest": "29.2.5",
50-
"typescript": "5.7.2",
51-
"typescript-eslint": "8.15.0"
48+
"typescript": "5.8.2",
49+
"typescript-eslint": "8.26.1",
50+
"vitest": "3.0.8"
5251
},
5352
"peerDependencies": {
5453
"@angular/compiler": "^17.3.9 || ^18.0.0 || ^19.0.0"

src/__snapshots__/utils.test.ts.snap

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`fitSpans start: 0, end: 15 1`] = `
3+
exports[`fitSpans > start: 0, end: 15 1`] = `
44
origin
55
> 1 | ( ( ( 1 ) ) )
66
| ^^^^^^^^^^^^^^^
@@ -12,7 +12,7 @@ outer hasParens=false
1212
| ^^^^^^^^^^^^^
1313
`;
1414

15-
exports[`fitSpans start: 1, end: 14 1`] = `
15+
exports[`fitSpans > start: 1, end: 14 1`] = `
1616
origin
1717
> 1 | ( ( ( 1 ) ) )
1818
| ^^^^^^^^^^^^^
@@ -24,7 +24,7 @@ outer hasParens=false
2424
| ^^^^^^^^^^^^^
2525
`;
2626

27-
exports[`fitSpans start: 2, end: 13 1`] = `
27+
exports[`fitSpans > start: 2, end: 13 1`] = `
2828
origin
2929
> 1 | ( ( ( 1 ) ) )
3030
| ^^^^^^^^^^^
@@ -36,7 +36,7 @@ outer hasParens=true
3636
| ^^^^^^^^^^^^^
3737
`;
3838

39-
exports[`fitSpans start: 3, end: 12 1`] = `
39+
exports[`fitSpans > start: 3, end: 12 1`] = `
4040
origin
4141
> 1 | ( ( ( 1 ) ) )
4242
| ^^^^^^^^^
@@ -48,7 +48,7 @@ outer hasParens=true
4848
| ^^^^^^^^^^^^^
4949
`;
5050

51-
exports[`fitSpans start: 4, end: 11 1`] = `
51+
exports[`fitSpans > start: 4, end: 11 1`] = `
5252
origin
5353
> 1 | ( ( ( 1 ) ) )
5454
| ^^^^^^^
@@ -60,7 +60,7 @@ outer hasParens=true
6060
| ^^^^^^^^^^^^^
6161
`;
6262

63-
exports[`fitSpans start: 5, end: 10 1`] = `
63+
exports[`fitSpans > start: 5, end: 10 1`] = `
6464
origin
6565
> 1 | ( ( ( 1 ) ) )
6666
| ^^^^^
@@ -72,7 +72,7 @@ outer hasParens=true
7272
| ^^^^^^^^^^^^^
7373
`;
7474

75-
exports[`fitSpans start: 6, end: 9 1`] = `
75+
exports[`fitSpans > start: 6, end: 9 1`] = `
7676
origin
7777
> 1 | ( ( ( 1 ) ) )
7878
| ^^^

src/transform-node.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ function isParenthesized(node: NGNode) {
1515
return Boolean(node.extra?.parenthesized);
1616
}
1717
function getOuterStart(node: NGNode): number {
18-
return isParenthesized(node) ? node.extra.parenStart : node.start;
18+
return isParenthesized(node) ? node.extra.parenStart : node.start!;
1919
}
2020
function getOuterEnd(node: NGNode): number {
21-
return isParenthesized(node) ? node.extra.parenEnd : node.end;
21+
return isParenthesized(node) ? node.extra.parenEnd : node.end!;
2222
}
2323

2424
function isOptionalObjectOrCallee(node: NGNode): boolean {
@@ -145,12 +145,7 @@ class Transformer extends Source {
145145
const right = this.#transform<babel.Expression>(originalRight);
146146
const start = getOuterStart(left);
147147
const end = getOuterEnd(right);
148-
const properties = {
149-
left,
150-
right,
151-
start,
152-
end,
153-
};
148+
const properties = { left, right, start, end };
154149

155150
if (operator === '&&' || operator === '||' || operator === '??') {
156151
return this.#create<babel.LogicalExpression>(

src/utils.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ describe('fitSpans', () => {
3535
}
3636
});
3737

38-
describe('getCharacterIndex', () => {
38+
test('getCharacterIndex', () => {
3939
expect(getCharacterIndex('foobar', /o/, 0)).toBe(1);
4040
expect(getCharacterIndex('foobar', /o/, 1)).toBe(1);
4141
expect(getCharacterIndex('foobar', 'o', 0)).toBe(1);
4242
expect(() => getCharacterIndex('foobar', '_', 0)).toThrow();
4343
});
4444

45-
describe('getCharacterLastIndex', () => {
45+
test('getCharacterLastIndex', () => {
4646
expect(getCharacterLastIndex('foobar', /o/, 6)).toBe(2);
4747
expect(getCharacterLastIndex('foobar', /o/, 2)).toBe(2);
4848
expect(getCharacterLastIndex('foobar', 'o', 6)).toBe(2);

0 commit comments

Comments
 (0)