Add support for TypeScript + TSX (#235)

This commit is contained in:
Pedro Ferreira 2024-08-09 21:13:20 +02:00 committed by GitHub
parent f913f23b23
commit a61334a955
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 1367 additions and 322 deletions

View File

@ -8,16 +8,13 @@ charset=utf-8
trim_trailing_whitespace=true trim_trailing_whitespace=true
insert_final_newline=true insert_final_newline=true
[{*.js,*.jsx}] [{*.js,*.jsx,*.ts,*.tsx}]
indent_size=2 indent_size=2
[{*.css,*.scss}] [{*.css,*.scss}]
indent_size=2 indent_size=2
[{*.yml,*.yaml}] [{*.yml,*.yaml,*.json}]
indent_size=2
[package.json]
indent_size=2 indent_size=2
[Makefile] [Makefile]

View File

@ -1,12 +1,13 @@
/* eslint-disable import/no-commonjs, import/unambiguous */ /* eslint-disable import/no-commonjs, import/unambiguous */
/* global module:false, __dirname:false */ /* global module:false, __dirname:false */
const path = require('path');
const fs = require('fs');
const {execSync} = require('child_process'); const {execSync} = require('child_process');
const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');
const _ = require('lodash'); const _ = require('lodash');
const resolve = require('resolve'); const resolve = require('resolve');
const yaml = require('js-yaml');
// Returns the path to the Indico source package/repo // Returns the path to the Indico source package/repo
const PATH_COMMAND = `python -c 'from flask.helpers import get_root_path; print(get_root_path("indico"))'`; const PATH_COMMAND = `python -c 'from flask.helpers import get_root_path; print(get_root_path("indico"))'`;
@ -63,7 +64,7 @@ module.exports = _.merge(defaultConfig, {
}, },
parserOptions: { parserOptions: {
babelOptions: { babelOptions: {
configFile: babelConfigFile configFile: babelConfigFile,
} },
} },
}); });

1651
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,11 @@
"repository": "https://github.com/indico/indico-plugins", "repository": "https://github.com/indico/indico-plugins",
"author": "Indico Team <indico-team@cern.ch>", "author": "Indico Team <indico-team@cern.ch>",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.24.7", "@babel/core": "^7.24.9",
"@babel/eslint-parser": "^7.18.2", "@babel/eslint-parser": "^7.24.8",
"eslint": "^8.17.0", "@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"eslint": "^8.57.0",
"eslint-cli": "^1.1.1", "eslint-cli": "^1.1.1",
"eslint-config-indico": "^2.0.0", "eslint-config-indico": "^2.0.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",

10
tsconfig.json Normal file
View File

@ -0,0 +1,10 @@
{
"extends": "../../src/tsconfig.json",
"compilerOptions": {
"baseUrl": "../../src",
},
"include": [
"../../src/indico/web/client/js/types",
"vc_zoom/indico_vc_zoom/client/**/*",
]
}