Skip to content

Commit cf637df

Browse files
authored
Update deps (#426)
1 parent 7f9e70f commit cf637df

File tree

7 files changed

+705
-558
lines changed

7 files changed

+705
-558
lines changed

.eslintrc.js

-31
This file was deleted.

.prettierrc.js

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/*
2-
* Copyright 2020 Google LLC
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
module.exports = {
182
arrowParens: 'always',
193
bracketSpacing: true,

bin/runTests.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -eEuo pipefail
3+
4+
#
5+
# As of Node 20, the --test parameter does not support globbing, and it does not
6+
# support variable Windows paths. We also cannot invoke the test runner
7+
# directly, because while it has an API, there's no way to force it to transpile
8+
# the Typescript into JavaScript before passing it to the runner.
9+
#
10+
# So we're left with this solution, which shells out to Node to list all files
11+
# that end in *.test.ts (excluding node_modules/), and then execs out to that
12+
# process. We have to exec so the stderr/stdout and exit code is appropriately
13+
# fed to the caller.
14+
#
15+
16+
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(' '));")"
17+
18+
set -x
19+
exec node --require ts-node/register --test-reporter spec --test ${FILES}

eslint.config.mjs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import js from '@eslint/js';
2+
import ts from 'typescript-eslint';
3+
import tsParser from '@typescript-eslint/parser';
4+
5+
import prettierRecommended from 'eslint-plugin-prettier/recommended';
6+
7+
export default ts.config(
8+
js.configs.recommended,
9+
ts.configs.eslintRecommended,
10+
{
11+
files: ['**/*.ts', '**/*.tsx'],
12+
languageOptions: {
13+
parser: tsParser,
14+
},
15+
},
16+
{ ignores: ['dist/', '**/*.js'] },
17+
{
18+
rules: {
19+
'no-unused-vars': 'off',
20+
},
21+
},
22+
prettierRecommended,
23+
);

0 commit comments

Comments
 (0)