Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to TypeScript 5.6.3 #523

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 9 additions & 135 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,45 +1,8 @@
/**
* Debugging:
* https://eslint.org/docs/latest/use/configure/debug
* ----------------------------------------------------
*
* Print a file's calculated configuration
*
* npx eslint --print-config path/to/file.js
*
* Inspecting the config
*
* npx eslint --inspect-config
*
*/

import globals from 'globals';
import js from '@eslint/js';

import ts from 'typescript-eslint';

import ember from 'eslint-plugin-ember/recommended';

import qunit from 'eslint-plugin-qunit';
import n from 'eslint-plugin-n';

import babelParser from '@babel/eslint-parser';

const parserOptions = {
esm: {
js: {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
requireConfigFile: false,
babelOptions: {
plugins: [
[
'@babel/plugin-proposal-decorators',
{ decoratorsBeforeExport: true },
],
],
},
},
ts: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
Expand All @@ -48,117 +11,28 @@ const parserOptions = {
};

export default ts.config(
js.configs.recommended,
ember.configs.base,
ember.configs.gjs,
ember.configs.gts,
/**
* Ignores must be in their own object
* https://eslint.org/docs/latest/use/configure/ignore
*/
{
ignores: [
'declarations/',
'dist/',
'.node_modules.ember-try/',
'coverage/',
'storybook-static/',
],
},
/**
* https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
*/
{
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
},
{
files: ['**/*.js'],
languageOptions: {
parser: babelParser,
},
},
{
files: ['**/*.{js,gjs}'],
languageOptions: {
parserOptions: parserOptions.esm.js,
globals: {
...globals.browser,
},
},
ignores: ['**/*.js', '**/*.mjs'],
},
{
name: 'ts',
files: ['**/*.ts'],
languageOptions: {
// Uncommenting this fixes the issue so it seems to be related to switching parsers for different kinds of typed files?
// parser: ember.parser,
parserOptions: parserOptions.esm.ts,
},
extends: [ember.configs.base, ...ts.configs.recommendedTypeChecked],
extends: [...ts.configs.recommendedTypeChecked],
// extends: [...ts.configs.recommended], // also fails
},
{
name: 'gts',
files: ['**/*.gts'],
languageOptions: {
parser: ember.parser,
parserOptions: parserOptions.esm.ts,
},
extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
rules: {
// This works around an issue in Glint https://github.com/typed-ember/glint/issues/697
// It also makes adding state to a component easier, since no other code changes would be needed.
'ember/no-empty-glimmer-component-classes': 'off',
},
},
{
files: ['tests/**/*-test.{js,gjs,ts,gts}'],
plugins: {
qunit,
},
},
/**
* CJS node files
*/
{
files: [
'index.js',
'**/*.cjs',
'config/**/*.js',
'testem.js',
'testem*.js',
'.prettierrc.js',
'.stylelintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'tests/dummy/config/**/*.js',
'.storybook/main.js',
],
plugins: {
n,
},

languageOptions: {
sourceType: 'script',
ecmaVersion: 'latest',
globals: {
...globals.node,
},
},
},
/**
* ESM node files
*/
{
files: ['**/*.mjs'],
plugins: {
n,
},

languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parserOptions: parserOptions.esm.js,
globals: {
...globals.node,
},
},
// These don't really matter, commented or not, it fails
// extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
},
);
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"stylelint-prettier": "^4.1.0",
"svg-symbols": "^1.0.5",
"tracked-built-ins": "^3.3.0",
"typescript": "~5.5.0",
"typescript": "~5.6.3",
"typescript-eslint": "^8.13.0",
"webpack": "^5.95.0"
},
Expand Down
Loading