From 6e637c0c28694d24263ddeee18206a7e5c7f727d Mon Sep 17 00:00:00 2001 From: Matej Voboril Date: Sat, 17 Feb 2024 22:50:06 -0600 Subject: [PATCH] feat: cjs/mjs extensions dependency updates --- .github/workflows/release.yaml | 5 ++--- .nvmrc | 1 + README.md | 8 +++---- configs/.eslintrc.js | 11 +++++++++- configs/esm.js | 4 ++-- configs/strict-esm-jsdoc.js | 4 ++-- configs/strict-jsdoc.js | 4 ++-- configs/typescript.js | 2 +- package.json | 40 +++++++++++++++++++--------------- 9 files changed, 47 insertions(+), 32 deletions(-) create mode 100644 .nvmrc diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 708ba95..2f6b8f7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,10 +15,10 @@ jobs: uses: actions/checkout@v4 with: token: ${{ secrets.GH_TOKEN }} - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version-file: '.nvmrc' - name: Install Dependencies run: npx npm-install-peers - name: Run linters @@ -29,7 +29,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} with: - semantic_version: 19 extra_plugins: | @semantic-release/git @semantic-release/changelog diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..c32828c --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/hydrogen \ No newline at end of file diff --git a/README.md b/README.md index 4969f66..a2021d4 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ you must still include babel config in your eslint config "parserOptions": { "babelOptions": { "plugins": [ - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-private-methods" + "@babel/plugin-transform-class-properties", + "@babel/plugin-transform-private-methods" ] } } @@ -38,8 +38,8 @@ as well as the accompanying babel config "@babel/preset-env" ], "plugins": [ - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-private-methods" + "@babel/plugin-transform-class-properties", + "@babel/plugin-transform-private-methods" ] } ``` diff --git a/configs/.eslintrc.js b/configs/.eslintrc.js index 91a9890..f7a1a94 100644 --- a/configs/.eslintrc.js +++ b/configs/.eslintrc.js @@ -65,6 +65,15 @@ module.exports = { 'newlines-between': 'always', }, ], + 'import/extensions': [ + 'error', + 'never', + { + json: 'always', + cjs: 'always', + mjs: 'always', + }, + ], 'no-null/no-null': 2, quotes: [ 2, @@ -89,7 +98,7 @@ module.exports = { sourceType: 'script', ecmaVersion: 6, babelOptions: { - plugins: ['@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-private-methods'], + plugins: ['@babel/plugin-transform-class-properties', '@babel/plugin-transform-private-methods'], }, }, }; diff --git a/configs/esm.js b/configs/esm.js index 396a464..340f5c4 100644 --- a/configs/esm.js +++ b/configs/esm.js @@ -14,8 +14,8 @@ module.exports = { }, babelOptions: { plugins: [ - '@babel/plugin-proposal-class-properties', - '@babel/plugin-proposal-private-methods', + '@babel/plugin-transform-class-properties', + '@babel/plugin-transform-private-methods', '@babel/plugin-syntax-import-assertions', ], }, diff --git a/configs/strict-esm-jsdoc.js b/configs/strict-esm-jsdoc.js index e0b2581..106c948 100644 --- a/configs/strict-esm-jsdoc.js +++ b/configs/strict-esm-jsdoc.js @@ -14,8 +14,8 @@ module.exports = { }, babelOptions: { plugins: [ - '@babel/plugin-proposal-class-properties', - '@babel/plugin-proposal-private-methods', + '@babel/plugin-transform-class-properties', + '@babel/plugin-transform-private-methods', '@babel/plugin-syntax-import-assertions', ], }, diff --git a/configs/strict-jsdoc.js b/configs/strict-jsdoc.js index 0b83a01..00737d8 100644 --- a/configs/strict-jsdoc.js +++ b/configs/strict-jsdoc.js @@ -10,8 +10,8 @@ module.exports = { ecmaVersion: 6, babelOptions: { plugins: [ - '@babel/plugin-proposal-class-properties', - '@babel/plugin-proposal-private-methods', + '@babel/plugin-transform-class-properties', + '@babel/plugin-transform-private-methods', '@babel/plugin-syntax-import-assertions', ], }, diff --git a/configs/typescript.js b/configs/typescript.js index e78013a..06365be 100644 --- a/configs/typescript.js +++ b/configs/typescript.js @@ -17,7 +17,7 @@ module.exports = { modules: true, }, babelOptions: { - plugins: ['@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-private-methods'], + plugins: ['@babel/plugin-transform-class-properties', '@babel/plugin-transform-private-methods'], }, }, }; diff --git a/package.json b/package.json index cd0b207..3eebf42 100644 --- a/package.json +++ b/package.json @@ -32,23 +32,29 @@ "./strict-esm-jsdoc": "./configs/strict-esm-jsdoc.js" }, "peerDependencies": { - "@babel/core": "^7.19.1", - "@babel/eslint-parser": "^7.19.1", - "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-private-methods": "^7.18.6", - "@babel/plugin-syntax-import-assertions": "^7.20.0", - "@babel/preset-env": "^7.19.1", - "@typescript-eslint/eslint-plugin": "^5.38.0", - "@typescript-eslint/parser": "^5.38.0", - "eslint": "^8.24.0", + "@babel/core": "^7.23.9", + "@babel/eslint-parser": "^7.23.10", + "@babel/plugin-transform-class-properties": "^7.23.3", + "@babel/plugin-transform-private-methods": "^7.23.3", + "@babel/plugin-syntax-import-assertions": "^7.23.3", + "@babel/preset-env": "^7.23.9", + "@typescript-eslint/eslint-plugin": "7.0.1", + "@typescript-eslint/parser": "7.0.1", + "eslint": "^8.56.0", "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-prettier": "^8.5.0", - "eslint-config-airbnb-typescript": "17.0.0", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-jsdoc": "^48.0.6", + "eslint-config-prettier": "^9.1.0", + "eslint-config-airbnb-typescript": "17.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsdoc": "^48.1.0", "eslint-plugin-no-null": "^1.0.2", - "eslint-plugin-prettier": "^4.2.1", - "prettier": "^2.7.1" + "eslint-plugin-prettier": "^5.1.3", + "prettier": "^3.2.5" + }, + "overrides": { + "eslint-config-airbnb-typescript": { + "@typescript-eslint/eslint-plugin": "^7.0.1", + "@typescript-eslint/parser": "^7.0.1" + } }, "engines": { "npm": ">=7" @@ -58,8 +64,8 @@ "@babel/preset-env" ], "plugins": [ - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-private-methods" + "@babel/plugin-transform-class-properties", + "@babel/plugin-transform-private-methods" ] }, "release": {