Skip to content

Commit

Permalink
Update docs, fix bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Sep 18, 2023
1 parent e24c480 commit c6a0488
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
3 changes: 2 additions & 1 deletion docs/source/contributing/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ myst:

# TypeScript

```{versionadded} 17.0.0-alpha.22
```{versionadded} 17.0.0-alpha.27
```

TypeScript support has been added to Volto core.
ESlint has been configured in order to accept code base written both in JavaScript and in TypeScript.
TypeScript in projects and add-ons has been supported since Volto 14.
Expand Down
14 changes: 5 additions & 9 deletions docs/source/upgrade-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,7 @@ It is recommended that you update your project's dependency on Razzle to this ve

### TypeScript support in Volto

```{versionadded} 17.0.0-alpha.22
We added full support of TypeScript in Volto core.
No existing code has been migrated.
You still have the freedom to develop using JavaScript.
It's your choice whether you want to do it in TypeScript.
In the past, you could add TypeScript support for Volto add-ons.
It's also available for projects now, if you upgrade dependencies (see next section).
```{versionadded} 17.0.0-alpha.22
```{versionadded} 17.0.0-alpha.27
```

We added full support of TypeScript in Volto core.
Expand All @@ -79,12 +72,14 @@ To support TypeScript in your projects, you must update your project as follows.
Edit your {file}`package.json`:

```diff
"scripts": {
- "lint": "./node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'",
- "lint:fix": "./node_modules/eslint/bin/eslint.js --max-warnings=0 --fix 'src/**/*.{js,jsx}'",
- "lint:ci": "./node_modules/eslint/bin/eslint.js --max-warnings=0 -f checkstyle 'src/**/*.{js,jsx}' > eslint.xml",
+ "lint": "./node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx,ts,tsx,json}'",
+ "lint:fix": "./node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx,ts,tsx,json}'",
+ "lint:ci": "./node_modules/eslint/bin/eslint.js --max-warnings=0 -f checkstyle 'src/**/*.{js,jsx,ts,tsx,json}' > eslint.xml",
}
```

```diff
Expand Down Expand Up @@ -163,8 +158,9 @@ make develop

### Upgrade ESlint and use `@babel/eslint-parser`

```{versionchanged} 17.0.0-alpha.22
```{versionchanged} 17.0.0-alpha.27
```

ESlint uses a library to parse the language under analysis.
The one used was long deprecated and didn't supported both TypeScript and JavaScript.
We upgraded the ESlint parser to use `@babel/eslint-parser`.
Expand Down

0 comments on commit c6a0488

Please sign in to comment.