Skip to content
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
32 changes: 0 additions & 32 deletions .babelrc

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

72 changes: 0 additions & 72 deletions .eslintrc

This file was deleted.

8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ analysis.json
analysis.out
analysis.md
tmp

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
23 changes: 22 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib"
"typescript.tsdk": "node_modules\\typescript\\lib",
"cSpell.words": [
"analyse",
"Annalyns",
"approvable",
"appuser",
"autoloading",
"elyses",
"exercism",
"gigasecond",
"markdownify",
"OPTIMISE",
"Optimised",
"Outputable",
"quasis",
"recognises",
"REPRESENTER",
"spawnable",
"templatable",
"TSES",
"whomst"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/index.cjs b/index.cjs
index 09b2b05459a1bab29283e5a1f4b5887b87bcc7a0..9f22f7c8f439c20348bcb67afb50117aa9689ef3 100644
--- a/index.cjs
+++ b/index.cjs
@@ -7,6 +7,7 @@ module.exports = function (_api, opts = {}) {
targets: {
node: 'current',
},
+ modules: false,
useBuiltIns: 'usage',
corejs: opts['corejs'] || '3.43',
},
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/index.cjs b/index.cjs
index 9f22f7c8f439c20348bcb67afb50117aa9689ef3..a20b57a8a28236df5cb2a92ea5b0e8e77065f1a1 100644
--- a/index.cjs
+++ b/index.cjs
@@ -12,7 +12,12 @@ module.exports = function (_api, opts = {}) {
corejs: opts['corejs'] || '3.43',
},
],
- require('@babel/preset-typescript'),
+ [
+ require('@babel/preset-typescript'),
+ {
+ "rewriteImportExtensions": true
+ }
+ ]
],
plugins: [],
};
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
14 changes: 14 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
presets: [['@exercism/babel-preset-typescript', { corejs: '3.43' }]],
plugins: [
[
'module-resolver',
{
alias: {
'~src': './src',
'~test': './test',
},
},
],
],
}
2 changes: 1 addition & 1 deletion docs/snapshot-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ is better, but too many is not good) fixture numbers to be tested.

```typescript
import { SlugAnalyzer } from '~src/analyzers/<type>/<slug>'
import { makeTestGenerator } from '~test/helpers/snapshot'
import { makeTestGenerator } from '~test/helpers/snapshot.js'

const snapshotTestsGenerator = makeTestGenerator(
'<slug>',
Expand Down
20 changes: 20 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// @ts-check

import config from '@exercism/eslint-config-tooling'

export default [
...config,
{
ignores: [
'.appends/**/*',
'.github/**/*',
'.vscode/**/*',
'bin/**/*',
'dist/**/*',
'test/fixtures/**/*',
'test_exercises/**/*',
'babel.config.js',
'jest.runner.config.js',
],
},
]
8 changes: 5 additions & 3 deletions jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ module.exports = {
moduleNameMapper: {
'^~src/(.*)$': '<rootDir>/src/$1',
'^~test/(.*)$': '<rootDir>/test/$1',
'(.+)\\.js': '$1',
},
testMatch: [
'**/__tests__/**/*.[jt]s?(x)',
'**/test/**/*.[jt]s?(x)',
'**/?(*.)+(spec|test).[jt]s?(x)',
'**/__tests__/**/*.[jt]s',
'**/test/**/*.[jt]s',
'**/?(*.)+(spec|test).[jt]s',
],
testPathIgnorePatterns: [
'/(?:production_)?node_modules/',
Expand All @@ -22,4 +23,5 @@ module.exports = {
transform: {
'^.+\\.[jt]sx?$': 'babel-jest',
},
extensionsToTreatAsEsm: ['.ts'],
}
54 changes: 24 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@exercism/javascript-analyzer",
"version": "0.22.0",
"version": "1.0.0",
"description": "Exercism analyzer for javascript",
"repository": "https://github.com/exercism/javascript-analyzer",
"author": "Derk-Jan Karrenbeld <[email protected]>",
Expand All @@ -16,6 +16,7 @@
"javascript-analyzer": "./bin/run.sh",
"javascript-analyzer-remote": "./bin/run.sh"
},
"type": "module",
"scripts": {
"analyze": "./bin/analyze.sh",
"analyze:bat": "./bin/analyze.bat",
Expand All @@ -29,38 +30,31 @@
"lint": "yarn eslint . --ext ts,js,tsx,jsx,mjs",
"test": "yarn build && yarn test:bare",
"test:e2e": "yarn build && node scripts/e2e",
"test:bare": "jest"
"test:bare": "yarn node --experimental-vm-modules --experimental-specifier-resolution=node $(yarn bin jest)"
},
"devDependencies": {
"@babel/cli": "~7.18.10",
"@babel/core": "~7.18.10",
"@babel/node": "~7.18.10",
"@babel/preset-env": "~7.18.10",
"@babel/preset-typescript": "~7.18.6",
"@tsconfig/recommended": "^1.0.1",
"@types/jest": "^27.5.2",
"@types/node": "^16.11.47",
"@types/yargs": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"babel-jest": "^27.5.1",
"babel-plugin-module-resolver": "^4.1.0",
"core-js": "^3.24.1",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.7.0",
"jest": "^27.5.1",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5"
"@babel/cli": "^7.27.2",
"@exercism/babel-preset-typescript": "patch:@exercism/babel-preset-typescript@patch%3A@exercism/babel-preset-typescript@npm%253A0.7.0%23~/.yarn/patches/@exercism-babel-preset-typescript-npm-0.7.0-2bbb0ae462.patch%3A%3Aversion=0.7.0&hash=a38e01#~/.yarn/patches/@exercism-babel-preset-typescript-patch-c49badc33d.patch",
"@exercism/eslint-config-tooling": "^0.9.0",
"@tsconfig/recommended": "^1.0.8",
"@types/node": "^22.15.31",
"@types/yargs": "^17.0.33",
"babel-jest": "^30.0.0",
"babel-plugin-module-resolver": "^5.0.2",
"core-js": "^3.43.0",
"eslint": "^9.28.0",
"jest": "^30.0.0",
"prettier": "^3.5.3",
"rimraf": "^6.0.1",
"shelljs": "^0.10.0"
},
"dependencies": {
"@exercism/static-analysis": "^0.12.0",
"@typescript-eslint/parser": "^5.32.0",
"@typescript-eslint/typescript-estree": "^5.32.0",
"@typescript-eslint/visitor-keys": "^5.32.0",
"typescript": "^4.7.4",
"yargs": "^17.5.1"
"@exercism/static-analysis": "^0.14.0",
"@typescript-eslint/parser": "^8.34.0",
"@typescript-eslint/typescript-estree": "^8.34.0",
"@typescript-eslint/visitor-keys": "^8.34.0",
"typescript": "^5.8.3",
"yargs": "^18.0.0"
},
"resolutions": {}
"packageManager": "[email protected]+sha512.f95ce356460e05be48d66401c1ae64ef84d163dd689964962c6888a9810865e39097a5e9de748876c2e0bf89b232d583c33982773e9903ae7a76257270986538"
}
Loading
Loading