Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

71 changes: 0 additions & 71 deletions .eslintrc.json

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ yarn-error.log
pnpm-debug.log
.parcel-cache
pnpm-lock.yaml
storybook-static
storybook-static

*.tgz
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"tabWidth": 2,
"printWidth": 120,
"endOfLine": "auto"
}
}
139 changes: 139 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat'
import { FlatCompat } from '@eslint/eslintrc'
import js from '@eslint/js'
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import _import from 'eslint-plugin-import'
import prettier from 'eslint-plugin-prettier'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import { defineConfig } from 'eslint/config'
import globals from 'globals'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})

export default defineConfig([
{ ignores: ['dist', 'node_modules'] },
{
extends: fixupConfigRules(
compat.extends(
'prettier',
'plugin:prettier/recommended',
'plugin:react-hooks/recommended',
'plugin:import/errors',
'plugin:import/warnings'
)
),

plugins: {
'@typescript-eslint': typescriptEslint,
react,
prettier: fixupPluginRules(prettier),
'react-hooks': fixupPluginRules(reactHooks),
import: fixupPluginRules(_import),
},
languageOptions: {
globals: {
...globals.browser,
...globals['shared-node-browser'],
...globals.node,
},

parser: tsParser,
ecmaVersion: 2018,
sourceType: 'module',

parserOptions: {
ecmaFeatures: {
jsx: true,
},

rules: {
curly: ['warn', 'multi-line', 'consistent'],
'no-console': 'off',
'no-empty-pattern': 'warn',
'no-duplicate-imports': 'error',

'import/no-unresolved': [
'error',
{
commonjs: true,
amd: true,
},
],

'import/export': 'error',
'import/named': 'off',
'import/namespace': 'off',
'import/default': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',

'no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],

'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],

'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
},

settings: {
react: {
version: 'detect',
},

'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],

'import/parsers': {
'@typescript-eslint/parser': ['.js', '.jsx', '.ts', '.tsx'],
},

'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
paths: ['src'],
},

alias: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
map: [['@react-three/postprocessing', './src/index.tsx']],
},
},
},
},
{
files: ['**/src'],

languageOptions: {
ecmaVersion: 5,
sourceType: 'script',

parserOptions: {
project: './tsconfig.json',
},
},
},
])
62 changes: 32 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,46 @@
"url": "git+https://github.com/pmndrs/react-postprocessing.git"
},
"scripts": {
"build": "rimraf dist && vite build && tsc",
"eslint": "eslint . --fix --ext=js,ts,jsx,tsx",
"eslint:ci": "eslint . --ext=js,ts,jsx,tsx",
"build": "vite build && tsc",
"eslint": "eslint . --fix",
"eslint:ci": "eslint .",
"test": "vitest run",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"maath": "^0.6.0",
"n8ao": "^1.9.4",
"postprocessing": "^6.36.6"
"maath": "^0.10.8",
"n8ao": "^2.0.0"
},
"devDependencies": {
"@react-three/fiber": "^9.0.4",
"@types/node": "^22.10.7",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@types/three": "^0.156.0",
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/parser": "^5.59.1",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
"@eslint/compat": "^2.1.0",
"@eslint/eslintrc": "^3.3.6",
"@eslint/js": "^9.39.5",
"@react-three/fiber": "^9.6.1",
"@types/node": "^26.1.1",
"@types/react": "^19.2.17",
"@types/three": "^0.182.0",
"@typescript-eslint/eslint-plugin": "^8.64.0",
"@typescript-eslint/parser": "^8.64.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^2.8.8",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"rimraf": "^6.0.1",
"three": "^0.156.0",
"typescript": "^5.0.4",
"vite": "^4.3.5",
"vitest": "^2.1.8"
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.1.1",
"globals": "^17.7.0",
"postprocessing": "^6.39.3",
"prettier": "^3.9.5",
"react": "^19.2.7",
"three": "^0.182.0",
"typescript": "^6.0.0",
"vite": "^8.1.4",
"vitest": "^4.1.10"
},
"peerDependencies": {
"@react-three/fiber": "^9.0.0",
"react": "^19.0",
"three": ">= 0.156.0"
"@react-three/fiber": ">=9.5.0",
"postprocessing": "^6.36.0",
"react": "^19.2.0",
"three": ">= 0.182.0"
}
}
12 changes: 6 additions & 6 deletions src/EffectComposer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import * as THREE from 'three'
import { vi, describe, it, expect } from 'vitest'
import { extend, createRoot, act } from '@react-three/fiber'
import { describe, it, expect } from 'vitest'
import { extend, createRoot } from '@react-three/fiber'
import { EffectComposer } from './EffectComposer'
import { EffectComposer as EffectComposerImpl, RenderPass, Pass, Effect, EffectPass } from 'postprocessing'

Expand Down Expand Up @@ -57,7 +57,7 @@ describe('EffectComposer', () => {
const passB = new Pass()

// Forward order
await act(async () =>
await React.act(async () =>
root.render(
<EffectComposer ref={composerRef}>
{/* EffectPass(effectA, effectB) */}
Expand Down Expand Up @@ -87,10 +87,10 @@ describe('EffectComposer', () => {
expect(composerRef.current!.passes[4]).toBe(passB)

// NOTE: instance children ordering is unstable until R3F v9, so we remount from scratch
await act(async () => root.render(null))
await React.act(async () => root.render(null))

// Reverse order
await act(async () =>
await React.act(async () =>
root.render(
<EffectComposer ref={composerRef}>
{/* PassB */}
Expand Down Expand Up @@ -121,6 +121,6 @@ describe('EffectComposer', () => {
})

it.skip('should split convolution effects', async () => {
await act(async () => root.render(null))
await React.act(async () => root.render(null))
})
})
10 changes: 6 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{
"compilerOptions": {
"target": "ES6",
"module": "ESNext",
"outDir": "dist",
"target": "esnext",
"module": "esnext",
"lib": ["esnext", "dom"],
"rootDir": "src",
"lib": ["ESNext", "DOM"],
"moduleResolution": "bundler",
"strict": true,
"jsx": "react-jsx",
"pretty": true,
"declaration": true,
"emitDeclarationOnly": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@react-three/postprocessing": ["./src"]
}
},
"include": ["src/**/*"],
"exclude": ["src/**/*.test.*"]
}
}
Loading
Loading