Skip to content

Commit

Permalink
Update dependencies (#29)
Browse files Browse the repository at this point in the history
* Update dependencies. Fix linting issues. New prettier rules.

* Fix rollup build process.

* Fix husky.

* Add back prebuild and prelint.
  • Loading branch information
dompuiu authored Feb 7, 2025
1 parent d580ebb commit 19b4cd0
Show file tree
Hide file tree
Showing 40 changed files with 5,470 additions and 6,541 deletions.
37 changes: 0 additions & 37 deletions .babelrc.cjs

This file was deleted.

4 changes: 4 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
last 2 Chrome versions
last 2 Firefox versions
last 2 Safari versions
last 2 Edge versions
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

79 changes: 0 additions & 79 deletions .eslintrc.cjs

This file was deleted.

4 changes: 1 addition & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

./node_modules/.bin/pretty-quick --staged
STAGED_ONLY=true npm run add-license
npm test
27 changes: 27 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"presets": ["@babel/typescript"],
"env": {
"development": {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
},
"production": {
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
]
]
}
}
}
68 changes: 68 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
Copyright 2024 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

import globals from "globals";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import nodePlugin from "eslint-plugin-n";
import pluginPromise from "eslint-plugin-promise";
import jest from "eslint-plugin-jest";

export default tseslint.config([
eslint.configs.recommended,
tseslint.configs.recommended,
pluginPromise.configs["flat/recommended"],
nodePlugin.configs["flat/recommended-script"],

{
ignores: [
"dist/**",
"lib/**",
"node_modules/**",
"coverage/**",
"types/**",
],
},

{
...jest.configs["flat/recommended"],

languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},

settings: {
parserOptions: {
project: "./tsconfig.json",
},
},

files: ["**/*.{js,cjs,mjs,ts}"],

rules: {
"@typescript-eslint/no-explicit-any": "off",
"n/no-missing-import": [
"error",
{
tryExtensions: [".ts", ".js"],
},
],
...jest.configs["flat/recommended"].rules,
},
},

eslintPluginPrettierRecommended,
]);
18 changes: 7 additions & 11 deletions jest.config.mjs → jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,17 @@ export default {
coverageDirectory: "coverage",

// An array of regexp pattern strings used to skip coverage collection
coveragePathIgnorePatterns: [
"/node_modules/",
"/dist/",
"/types/"
],
coveragePathIgnorePatterns: ["/node_modules/", "/dist/", "/types/"],

// Indicates which provider should be used to instrument code for coverage
// coverageProvider: "babel",

// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: [
"json-summary",
// "text",
"lcov",
// "clover"
"json-summary",
// "text",
"lcov",
// "clover"
],

// An object that configures minimum threshold enforcement for coverage results
Expand All @@ -49,8 +45,8 @@ export default {
branches: 80,
functions: 90,
lines: 90,
statements: 90
}
statements: 90,
},
},

// A path to a custom dependency extractor
Expand Down
Loading

0 comments on commit 19b4cd0

Please sign in to comment.