mirror of
https://github.com/flarum/framework.git
synced 2025-02-16 23:32:45 +08:00
Initial commit
This commit is contained in:
commit
36f546aefa
16
js-packages/tsconfig/.gitattributes
vendored
Normal file
16
js-packages/tsconfig/.gitattributes
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
|
||||
* text=auto eol=lf
|
4
js-packages/tsconfig/.gitignore
vendored
Normal file
4
js-packages/tsconfig/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
.DS_Store
|
||||
Thumbs.db
|
||||
.idea/*
|
||||
.vscode
|
29
js-packages/tsconfig/README.md
Normal file
29
js-packages/tsconfig/README.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Flarum Typescript Config
|
||||
|
||||
A standardised `tsconfig.json` for use in Typescript Flarum extensions.
|
||||
|
||||
## Usage
|
||||
|
||||
You'll need to configure a `tsconfig.json` file to ensure your IDE sets up Typescript support correctly.
|
||||
|
||||
You need to install this package as a dev dependency:
|
||||
|
||||
```properties
|
||||
npm install --save-dev flarum-tsconfig
|
||||
yarn add --dev flarum-tsconfig
|
||||
```
|
||||
|
||||
A baseline `tsconfig.json` is provided below that you can modify as needed. This file needs to be copied into your extension's `js` folder for your IDE to apply the correct settings.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
// Use Flarum's tsconfig as a starting point
|
||||
"extends": "flarum-tsconfig",
|
||||
// This will match all .ts, .tsx, .d.ts, .js, .jsx files
|
||||
"includes": ["src/**/*"],
|
||||
"compilerOptions": {
|
||||
// This will output typings to `dist-typings`
|
||||
"declarationDir": "./dist-typings"
|
||||
}
|
||||
}
|
||||
```
|
9
js-packages/tsconfig/package.json
Normal file
9
js-packages/tsconfig/package.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "flarum-tsconfig",
|
||||
"version": "0.1.0-beta.16",
|
||||
"description": "Flarum's official Typescript config file",
|
||||
"main": "tsconfig.json",
|
||||
"repository": "https://github.com/flarum/flarum-tsconfig",
|
||||
"author": "Flarum Team",
|
||||
"license": "MIT"
|
||||
}
|
22
js-packages/tsconfig/tsconfig.json
Normal file
22
js-packages/tsconfig/tsconfig.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"allowUmdGlobalAccess": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitThis": true,
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"module": "es2015",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "Node",
|
||||
"target": "es6",
|
||||
"jsx": "preserve",
|
||||
"allowJs": true,
|
||||
"lib": ["es2015", "es2017", "dom"],
|
||||
"allowSyntheticDefaultImports": true
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user