Skip to content

Commit

Permalink
Update deps (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo authored Aug 5, 2024
1 parent 7f9e70f commit cf637df
Show file tree
Hide file tree
Showing 7 changed files with 705 additions and 558 deletions.
31 changes: 0 additions & 31 deletions .eslintrc.js

This file was deleted.

16 changes: 0 additions & 16 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/*
* Copyright 2020 Google LLC
*
* Licensed 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 CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = {
arrowParens: 'always',
bracketSpacing: true,
Expand Down
19 changes: 19 additions & 0 deletions bin/runTests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -eEuo pipefail

#
# As of Node 20, the --test parameter does not support globbing, and it does not
# support variable Windows paths. We also cannot invoke the test runner
# directly, because while it has an API, there's no way to force it to transpile
# the Typescript into JavaScript before passing it to the runner.
#
# So we're left with this solution, which shells out to Node to list all files
# that end in *.test.ts (excluding node_modules/), and then execs out to that
# process. We have to exec so the stderr/stdout and exit code is appropriately
# fed to the caller.
#

FILES="$(node -e "process.stdout.write(require('node:fs').readdirSync('./', { recursive: true }).filter((e) => {return e.endsWith('.test.ts') && !e.startsWith('node_modules');}).sort().join(' '));")"

set -x
exec node --require ts-node/register --test-reporter spec --test ${FILES}
23 changes: 23 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import js from '@eslint/js';
import ts from 'typescript-eslint';
import tsParser from '@typescript-eslint/parser';

import prettierRecommended from 'eslint-plugin-prettier/recommended';

export default ts.config(
js.configs.recommended,
ts.configs.eslintRecommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsParser,
},
},
{ ignores: ['dist/', '**/*.js'] },
{
rules: {
'no-unused-vars': 'off',
},
},
prettierRecommended,
);
Loading

0 comments on commit cf637df

Please sign in to comment.