Skip to content

Commit bd8ea65

Browse files
feat: Support TypeScript
1 parent ab08bd3 commit bd8ea65

32 files changed

+6668
-36790
lines changed

.eslintrc

-34
This file was deleted.

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@ npm-debug.log*
1919
yarn-debug.log*
2020
yarn-error.log*
2121

22+
# Editor directories and files
23+
.vscode/*
24+
!.vscode/extensions.json
25+
.idea
26+
.DS_Store
27+
*.suo
28+
*.ntvs*
29+
*.njsproj
30+
*.sln
31+
*.sw?

eslint.config.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tsEslint from 'typescript-eslint'
6+
7+
export default tsEslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tsEslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2022,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)

example/public/index.html renamed to example/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
content="React Scrollama is a lightweight interface for scrollytelling that uses the IntersectionObserver in favor of scroll events."
3131
/>
3232

33-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
33+
<link rel="manifest" href="/manifest.json" />
3434

3535
<title>React Scrollama: Scrollytelling for React</title>
3636

@@ -57,5 +57,6 @@
5757
</noscript>
5858

5959
<div id="root"></div>
60+
<script type="module" src="/src/index.tsx"></script>
6061
</body>
6162
</html>

0 commit comments

Comments
 (0)