Skip to content

Commit 48b9897

Browse files
authored
Merge pull request #707 from share/typescript-initial-2
Initial TypeScript setup and conversion (CJS to ESM, ES5 class functions to ES6 classes)
2 parents 3552c28 + f011782 commit 48b9897

80 files changed

Lines changed: 8020 additions & 7403 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
push:
55
branches:
66
- master
7+
- typescript
78
pull_request:
89
branches:
910
- master
11+
- typescript
1012

1113
jobs:
1214
test:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ node_modules
3636
package-lock.json
3737
jspm_packages
3838

39+
# TypeScript output
40+
lib/
41+
3942
# Don't commit generated JS bundles
4043
examples/**/static/dist/bundle.js
4144
examples/**/dist

eslint.config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
const js = require("@eslint/js");
1+
const jsEslint = require("@eslint/js");
22
const {
33
defineConfig,
44
globalIgnores,
55
} = require("eslint/config");
66
const eslintConfigGoogle = require('eslint-config-google');
7+
const tsEslint = require('typescript-eslint');
78

89
// The ESLint ecmaVersion argument is inconsistently used. Some rules will ignore it entirely, so if the rule has
910
// been set, it will still error even if it's not applicable to that version number. Since Google sets these
@@ -54,7 +55,8 @@ var SHAREDB_RULES = {
5455
module.exports = defineConfig([
5556
{
5657
extends: [eslintConfigGoogle],
57-
ignores: ['eslint.config.js'],
58+
files: ["**/*.js"],
59+
ignores: ["eslint.config.js", "lib/**"],
5860

5961
languageOptions: {
6062
ecmaVersion: 3,
@@ -67,6 +69,13 @@ module.exports = defineConfig([
6769

6870
rules: Object.assign({}, DISABLED_ES6_OPTIONS, SHAREDB_RULES),
6971
},
72+
// {
73+
// extends: [
74+
// jsEslint.configs.recommended,
75+
// tsEslint.configs.recommended,
76+
// ],
77+
// files: ["**/*.ts"],
78+
// },
7079
globalIgnores(["docs/"]),
7180
{
7281
files: ["examples/counter-json1-vite/*.js"],

0 commit comments

Comments
 (0)