Skip to content
Open
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
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

67 changes: 0 additions & 67 deletions .eslintrc.js

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '20.x'
cache: 'pnpm'
- name: install dependencies
run: pnpm install
Expand All @@ -34,7 +34,7 @@ jobs:

strategy:
matrix:
node: [18, 20, 22]
node: [20, 22]
os: [ubuntu, windows]

steps:
Expand All @@ -47,7 +47,7 @@ jobs:
- run: pnpm install
- run: pnpm build
- name: test
run: pnpm npm-run-all test:*
run: pnpm test

floating-test:
name: Floating dependencies
Expand All @@ -58,9 +58,9 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '20.x'
cache: 'pnpm'
- run: pnpm install --no-lockfile
- run: pnpm build
- name: test
run: pnpm test:jest
run: pnpm test
16 changes: 7 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
dist/

# dependencies
/node_modules
node_modules/

# misc
npm-debug.log*
yarn-error.log
/.vscode
/.log/

# compiled output
/lib
.DS_Store
.env*
.eslintcache
pnpm-debug.log*
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
auto-install-peers=false
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
resolve-peers-from-workspace-root=false
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.19.6
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# compiled output
/dist/

# misc
pnpm-lock.yaml
!.*
.*/

# specific to this package
CHANGELOG.md
README.md
7 changes: 0 additions & 7 deletions .prettierrc.js

This file was deleted.

109 changes: 109 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import babelEslintParser from '@babel/eslint-parser';
import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginImportX from 'eslint-plugin-import-x';
import eslintPluginN from 'eslint-plugin-n';
import globals from 'globals';
import tseslint from 'typescript-eslint';

const parserOptionsJs = {
ecmaFeatures: {
modules: true,
},
ecmaVersion: 'latest',
requireConfigFile: false,
};

const parserOptionsTs = {
projectService: true,
};

export default tseslint.config(
{
ignores: ['dist/', 'node_modules/', '.*/'],
},
{
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
},

eslint.configs.recommended,
eslintPluginImportX.flatConfigs.recommended,
eslintConfigPrettier,
{
rules: {
curly: 'error',
'import-x/no-duplicates': 'error',
'import-x/no-unresolved': 'off',
},
},

// JavaScript files
{
files: ['**/*.js'],
languageOptions: {
parser: babelEslintParser,
parserOptions: parserOptionsJs,
},
},

// TypeScript files
{
extends: [
tseslint.configs.recommendedTypeChecked,
eslintPluginImportX.flatConfigs.typescript,
],
files: ['**/*.ts'],
languageOptions: {
parserOptions: parserOptionsTs,
},
rules: {
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/method-signature-style': ['error', 'property'],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'import-x/no-named-as-default-member': 'off',
'prefer-const': 'off',
},
settings: {
'import-x/resolver': {
node: true,
typescript: true,
},
},
},

// Configuration files
{
...eslintPluginN.configs['flat/recommended-script'],
files: ['**/*.cjs', 'jest.config.js'],
languageOptions: {
ecmaVersion: 'latest',
globals: globals.node,
sourceType: 'script',
},
plugins: {
n: eslintPluginN,
},
},
{
...eslintPluginN.configs['flat/recommended-module'],
files: ['**/*.mjs'],
languageOptions: {
ecmaVersion: 'latest',
globals: globals.node,
parserOptions: parserOptionsJs,
sourceType: 'module',
},
plugins: {
n: eslintPluginN,
},
},
);
2 changes: 1 addition & 1 deletion jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src/'],
testEnvironment: 'node',
};
75 changes: 36 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,27 @@
"repository": "github:ember-template-lint/ember-template-recast",
"license": "MIT",
"author": "Robert Jackson <[email protected]>",
"main": "lib/index.js",
"bin": "lib/bin.js",
"main": "dist/index.js",
"bin": "dist/bin.js",
"files": [
"lib/",
"!lib/**/*.test.*"
"dist/",
"!dist/**/*.test.*"
],
"scripts": {
"build": "tsc",
"lint": "npm-run-all lint:*",
"lint:files": "eslint .",
"lint:tsc": "tsc --noEmit",
"format": "prettier . --cache --write",
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" && pnpm format",
"lint:format": "prettier . --cache --check",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:types": "tsc --noEmit",
"perf:benchmark": "node scripts/benchmark.mjs",
"prepare": "tsc",
"test": "npm-run-all lint test:*",
"test:jest": "jest"
"prepare": "pnpm build",
"test": "jest"
},
"dependencies": {
"@glimmer/syntax": ">= 0.84.3",
"@types/tmp": "^0.2.6",
"@glimmer/syntax": "^0.95.0",
"async-promise-queue": "^1.0.5",
"colors": "^1.4.0",
"commander": "^8.3.0",
Expand All @@ -44,43 +46,38 @@
"workerpool": "^6.4.0"
},
"devDependencies": {
"@types/jest": "^27.4.0",
"@babel/core": "^7.29.0",
"@babel/eslint-parser": "^7.28.6",
"@eslint/js": "^9.39.4",
"@glimmer/reference": "^0.94.9",
"@glimmer/validator": "^0.95.0",
"@types/jest": "^30.0.0",
"@types/node": "^20.19.37",
"@types/tmp": "^0.2.6",
"@types/workerpool": "^6.1.1",
"@glimmer/reference": "^0.84.3",
"@glimmer/validator": "^0.84.3",
"@typescript-eslint/eslint-plugin": "^5.9.1",
"@typescript-eslint/parser": "^5.9.1",
"benchmark": "^2.1.4",
"broccoli-test-helper": "^2.0.0",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"concurrently": "^9.2.1",
"eslint": "^9.39.4",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import-x": "^4.16.2",
"eslint-plugin-n": "^17.24.0",
"execa": "^5.1.1",
"jest": "^26.6.3",
"npm-run-all": "^4.1.5",
"globals": "^17.4.0",
"jest": "^30.3.0",
"outdent": "^0.8.0",
"prettier": "^2.5.1",
"prettier": "^3.8.1",
"release-plan": "^0.16.0",
"ts-jest": "^26.5.6",
"typescript": "~4.9.5"
"ts-jest": "^29.4.6",
"typescript": "^5.9.3",
"typescript-eslint": "^8.57.0"
},
"packageManager": "pnpm@10.9.0",
"packageManager": "pnpm@10.32.1",
"engines": {
"node": ">= 18.12"
"node": "20.* || >= 22"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"pnpm": {
"overrides": {
"@glimmer/reference": "0.84.3",
"@glimmer/syntax": "0.84.3",
"@glimmer/validator": "0.84.3"
},
"override-nodes": [
"@glimmer/* pinned for typescript reasons",
"TODO: We should test against a range of @glimmer/syntaxes -- or bump to 1.0"
]
}
}
Loading