-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4824 from remotion-dev/eslint-9
- Loading branch information
Showing
23 changed files
with
975 additions
and
624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {build} from 'bun'; | ||
|
||
if (process.env.NODE_ENV !== 'production') { | ||
throw new Error('This script must be run using NODE_ENV=production'); | ||
} | ||
|
||
const output = await build({ | ||
entrypoints: ['src/index.ts'], | ||
naming: '[name].mjs', | ||
target: 'node', | ||
external: [], | ||
}); | ||
|
||
const [file] = output.outputs; | ||
const text = await file.text(); | ||
|
||
await Bun.write('dist/esm/index.mjs', text); | ||
|
||
export {}; | ||
console.log('Generated.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {remotionFlatConfig} from '@remotion/eslint-config-internal'; | ||
|
||
const config = remotionFlatConfig({react: false}); | ||
|
||
export default { | ||
...config, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"repository": { | ||
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/eslint-config-flat" | ||
}, | ||
"name": "@remotion/eslint-config-flat", | ||
"version": "4.0.252", | ||
"description": "Default configuration for Remotion templates", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"lint": "eslint src", | ||
"formatting": "prettier src --check", | ||
"make": "tsc -d && bun --env-file=../.env.bundle bundle.ts" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/remotion-dev/remotion/issues" | ||
}, | ||
"author": "Jonny Burger <[email protected]>", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@remotion/eslint-plugin": "workspace:*", | ||
"typescript-eslint": "8.21.0", | ||
"@eslint/js": "9.14.0", | ||
"eslint-plugin-react": "7.37.4", | ||
"eslint-plugin-react-hooks": "5.2.0-canary-de1eaa26-20250124" | ||
}, | ||
"peerDependencies": { | ||
"eslint": ">=9" | ||
}, | ||
"devDependencies": { | ||
"@remotion/eslint-config-internal": "workspace:*", | ||
"eslint": "9.14.0" | ||
}, | ||
"keywords": [ | ||
"remotion", | ||
"video", | ||
"react", | ||
"player" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"homepage": "https://www.remotion.dev/docs/brownfield#install-the-eslint-plugin" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
export const autoImports = { | ||
useRef: "import {useRef} from 'react'", | ||
useEffect: "import {useEffect} from 'react'", | ||
useState: "import {useState} from 'react'", | ||
useCallback: "import {useCallback} from 'react'", | ||
useMemo: "import {useMemo} from 'react'", | ||
useReducer: "import {useReducer} from 'react'", | ||
useCurrentFrame: "import {useCurrentFrame} from 'remotion'", | ||
useVideoConfig: "import {useVideoConfig} from 'remotion'", | ||
spring: "import {spring} from 'remotion'", | ||
measureSpring: "import {measureSpring} from 'remotion'", | ||
random: "import {random} from 'remotion'", | ||
interpolate: "import {interpolate} from 'remotion'", | ||
interpolateColors: "import {interpolateColors} from 'remotion'", | ||
Easing: "import {Easing} from 'remotion'", | ||
getInputProps: "import {getInputProps} from 'remotion'", | ||
getStaticFiles: "import {getStaticFiles} from '@remotion/studio'", | ||
watchStaticFiles: "import {watchStaticFiles} from '@remotion/studio'", | ||
continueRender: "import {continueRender} from 'remotion'", | ||
delayRender: "import {delayRender} from 'remotion'", | ||
AbsoluteFill: "import {AbsoluteFill} from 'remotion'", | ||
Sequence: "import {Sequence} from 'remotion'", | ||
Composition: "import {Composition} from 'remotion'", | ||
Audio: "import {Audio} from 'remotion'", | ||
Video: "import {Video} from 'remotion'", | ||
OffthreadVideo: "import {OffthreadVideo} from 'remotion'", | ||
Series: "import {Series} from 'remotion'", | ||
Still: "import {Still} from 'remotion'", | ||
Freeze: "import {Freeze} from 'remotion'", | ||
Loop: "import {Loop} from 'remotion'", | ||
staticFile: "import {staticFile} from 'remotion'", | ||
Config: "import {Config} from '@remotion/cli/config'", | ||
Img: "import {Img} from 'remotion'", | ||
IFrame: "import {IFrame} from 'remotion'", | ||
Folder: "import {Folder} from 'remotion'", | ||
useCurrentScale: "import {useCurrentScale} from 'remotion'", | ||
VERSION: "import {VERSION} from 'remotion'", | ||
watchStaticFile: "import {watchStaticFile} from 'remotion'", | ||
z: "import {z} from 'zod'", | ||
styled: "import styled from 'styled-components'", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import eslint from '@eslint/js'; | ||
import remotionPlugin from '@remotion/eslint-plugin'; | ||
import reactPlugin from 'eslint-plugin-react'; | ||
// @ts-expect-error no types | ||
import hooksPlugin from 'eslint-plugin-react-hooks'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
export const config: tseslint.ConfigArray = tseslint.config( | ||
{ | ||
ignores: ['**/build/**', '**/dist/**', '**/out/**'], | ||
}, | ||
eslint.configs.recommended, | ||
tseslint.configs.recommended, | ||
{ | ||
plugins: { | ||
react: reactPlugin, | ||
'react-hooks': hooksPlugin, | ||
'@remotion': remotionPlugin, | ||
}, | ||
languageOptions: { | ||
...reactPlugin.configs.flat.recommended.languageOptions, | ||
parser: tseslint.parser, | ||
parserOptions: { | ||
projectService: true, | ||
}, | ||
}, | ||
rules: { | ||
...reactPlugin.configs.recommended.rules, | ||
...hooksPlugin.configs.recommended.rules, | ||
...remotionPlugin.configs.recommended.rules, | ||
// Turning off rules that are too strict or don't apply to Remotion | ||
'no-console': 'off', | ||
'react/jsx-key': 'off', | ||
'react/jsx-no-target-blank': 'off', | ||
// In Root.tsx we encourage using fragment for just a single composition | ||
// since we intend to add more compositions later and you should then use a fragment. | ||
'react/jsx-no-useless-fragment': 'off', | ||
// This is generally okay because on every frame, there will be a full rerender anyway! | ||
'react/no-array-index-key': 'off', | ||
'react/react-in-jsx-scope': 'off', | ||
'react/prop-types': 'off', | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.js'], | ||
extends: [tseslint.configs.disableTypeChecked], | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": "../tsconfig.settings.json", | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist", | ||
"skipLibCheck": true, | ||
"jsx": "react-jsx", | ||
"module": "NodeNext", | ||
"resolveJsonModule": false, | ||
"moduleResolution": "nodenext" | ||
}, | ||
"include": ["./src"], | ||
"references": [ | ||
{ | ||
"path": "../eslint-plugin" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,18 +19,16 @@ | |
}, | ||
"author": "Jonny Burger <[email protected]>", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@remotion/eslint-plugin": "workspace:*", | ||
"@typescript-eslint/eslint-plugin": "6.21.0", | ||
"@typescript-eslint/parser": "6.21.0", | ||
"eslint-plugin-10x": "1.5.2", | ||
"eslint-plugin-react": "7.37.2", | ||
"eslint-plugin-react-hooks": "4.6.0" | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"eslint": ">=7.15.0" | ||
}, | ||
"devDependencies": { | ||
"@remotion/eslint-plugin": "workspace:*", | ||
"@typescript-eslint/eslint-plugin": "6.21.0", | ||
"@typescript-eslint/parser": "6.21.0", | ||
"eslint-plugin-react": "7.37.4", | ||
"eslint-plugin-react-hooks": "4.6.0", | ||
"@remotion/eslint-config-internal": "workspace:*", | ||
"eslint": "9.14.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.