Skip to content

Commit d9429d1

Browse files
authored
Merge pull request #127 from gitKrystan/upgrade-typescript
2 parents 3551f5b + 00a5159 commit d9429d1

27 files changed

Lines changed: 123 additions & 151 deletions

.eslintrc.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
project: './tsconfig.lint.json',
1717
allowAutomaticSingleRunInference: true,
1818
},
19-
plugins: ['@typescript-eslint', 'jsdoc', 'unicorn'],
19+
plugins: ['@typescript-eslint', 'jsdoc', 'unicorn', 'simple-import-sort'],
2020
root: true,
2121
reportUnusedDisableDirectives: true,
2222
rules: {
@@ -30,13 +30,7 @@ module.exports = {
3030
],
3131
'@typescript-eslint/consistent-type-assertions': 'error',
3232
'@typescript-eslint/consistent-type-definitions': 'error',
33-
'@typescript-eslint/consistent-type-imports': [
34-
'error',
35-
{
36-
prefer: 'type-imports',
37-
fixStyle: 'inline-type-imports',
38-
},
39-
],
33+
'@typescript-eslint/consistent-type-imports': 'error',
4034
'@typescript-eslint/explicit-function-return-type': [
4135
'error',
4236
{ allowExpressions: true },
@@ -76,6 +70,8 @@ module.exports = {
7670
'jsdoc/require-param': 'off',
7771
'jsdoc/require-param-type': 'off',
7872
'jsdoc/tag-lines': 'off',
73+
'simple-import-sort/imports': 'error',
74+
'simple-import-sort/exports': 'error',
7975
'unicorn/consistent-function-scoping': [
8076
'error',
8177
{ checkArrowFunctions: false },

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// Turn off this formatter so Prettier will be the only formatter and the user won't have to pick.
1111
"javascript.format.enable": false,
1212
"editor.codeActionsOnSave": {
13-
"source.fixAll": true,
14-
"source.organizeImports": true
13+
"source.fixAll": true
1514
}
1615
}

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"build": "tsc && vite build",
3333
"preexample": "vite build",
3434
"example": "pnpm preexample && cd examples && pnpm example",
35-
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
36-
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"",
35+
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefix-colors auto",
36+
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefix-colors auto",
3737
"lint:eslint": "eslint . --cache",
3838
"lint:eslint:fix": "eslint . --fix",
3939
"lint:prettier": "prettier --check .",
@@ -42,7 +42,7 @@
4242
"release": "release-it",
4343
"release:ci": "release-it --ci",
4444
"release:debug": "release-it --verbose --dry-run",
45-
"test:all": "concurrently \"pnpm:test:run\" \"pnpm:test:example\"",
45+
"test:all": "concurrently \"pnpm:test:run\" \"pnpm:test:example\" --prefix-colors auto",
4646
"test": "vitest",
4747
"test:example": "pnpm preexample && cd examples && pnpm test",
4848
"test:ui": "vitest --ui",
@@ -53,7 +53,7 @@
5353
"@glimmer/syntax": "^0.84.3",
5454
"ember-cli-htmlbars": "^6.3.0",
5555
"ember-template-imports": "^3.4.2",
56-
"prettier": "^3.0.0"
56+
"prettier": "^3.0.3"
5757
},
5858
"devDependencies": {
5959
"@babel/types": "^7.22.11",
@@ -72,11 +72,12 @@
7272
"eslint-plugin-eslint-comments": "^3.2.0",
7373
"eslint-plugin-jsdoc": "^46.5.1",
7474
"eslint-plugin-n": "^16.0.2",
75+
"eslint-plugin-simple-import-sort": "^10.0.0",
7576
"eslint-plugin-unicorn": "^48.0.1",
7677
"eslint-plugin-vitest": "^0.3.1",
7778
"prettier-plugin-jsdoc": "^1.0.1",
7879
"release-it": "^16.1.5",
79-
"typescript": "^5.1.6",
80+
"typescript": "^5.2.2",
8081
"vite": "^4.4.9",
8182
"vitest": "^0.34.3"
8283
},

pnpm-lock.yaml

Lines changed: 33 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-expect-error FIXME: TS7016 Get ETI to export these + types
2-
import * as util from 'ember-template-imports/src/util';
2+
import * as util from 'ember-template-imports/src/util.js';
33

44
export const PARSER_NAME = 'ember-template-tag';
55
export const PRINTER_NAME = 'ember-template-tag-estree';

src/main.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import type { Node } from '@babel/types';
22
import type { Parser, Plugin, Printer, SupportLanguage } from 'prettier';
3-
import { PARSER_NAME, PRINTER_NAME } from './config';
4-
import { options } from './options';
5-
import { parser } from './parse';
6-
import { printer } from './print/index';
3+
4+
import { PARSER_NAME, PRINTER_NAME } from './config.js';
5+
import { options } from './options.js';
6+
import { parser } from './parse.js';
7+
import { printer } from './print/index.js';
78

89
const languages: SupportLanguage[] = [
910
{

src/parse.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ import {
77
isTaggedTemplateExpression,
88
} from '@babel/types';
99
import { getTemplateLocals } from '@glimmer/syntax';
10-
import { preprocessEmbeddedTemplates } from 'ember-template-imports/lib/preprocess-embedded-templates';
10+
import { preprocessEmbeddedTemplates } from 'ember-template-imports/lib/preprocess-embedded-templates.js';
1111
import type { Parser } from 'prettier';
12-
import { parsers as babelParsers } from 'prettier/plugins/babel';
12+
import { parsers as babelParsers } from 'prettier/plugins/babel.js';
13+
1314
import {
1415
PRINTER_NAME,
1516
TEMPLATE_TAG_NAME,
1617
TEMPLATE_TAG_PLACEHOLDER,
1718
} from './config';
18-
import type { Options } from './options';
19+
import type { Options } from './options.js';
1920
import type {
2021
GlimmerExpressionExtra,
2122
GlimmerTemplateExtra,
@@ -36,8 +37,8 @@ import {
3637
isRawGlimmerCallExpression,
3738
isRawGlimmerClassProperty,
3839
} from './types/raw';
39-
import { hasAmbiguousNextLine } from './utils/ambiguity';
40-
import { assert, squish } from './utils/index';
40+
import { hasAmbiguousNextLine } from './utils/ambiguity.js';
41+
import { assert, squish } from './utils/index.js';
4142

4243
const typescript = babelParsers['babel-ts'] as Parser<Node | undefined>;
4344

0 commit comments

Comments
 (0)