Skip to content
Merged
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
35 changes: 0 additions & 35 deletions .eslintrc

This file was deleted.

114 changes: 114 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": [
"typescript"
],
"categories": {
"correctness": "off"
},
"env": {
"builtin": true,
"browser": true,
"node": true
},
"ignorePatterns": [
"build/**"
],
"rules": {
"constructor-super": "error",
"for-direction": "error",
"getter-return": "error",
"no-async-promise-executor": "error",
"no-case-declarations": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-const-assign": "error",
"no-constant-binary-expression": "error",
"no-constant-condition": "error",
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-class-members": "error",
"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-empty-static-block": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-import-assign": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-new-native-nonconstructor": "error",
"no-nonoctal-decimal-escape": "error",
"no-obj-calls": "error",
"no-prototype-builtins": "error",
"no-redeclare": "error",
"no-regex-spaces": "error",
"no-self-assign": "error",
"no-setter-return": "error",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-this-before-super": "error",
"no-unexpected-multiline": "error",
"no-unreachable": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-labels": "error",
"no-unused-private-class-members": "error",
"no-undef": "error",
"no-unused-vars": [
"warn",
{
"ignoreRestSiblings": true
}
],
"no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-escape": "error",
"no-with": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error",
"no-array-constructor": "error",
"no-unused-expressions": "error",
"curly": [
"warn",
"multi-line"
],
"no-console": "error",
"no-use-before-define": [
"warn",
"nofunc"
],
"no-underscore-dangle": "off",
"new-cap": "off",
"prefer-const": "warn",
"typescript/ban-ts-comment": "error",
"typescript/no-duplicate-enum-values": "error",
"typescript/no-empty-object-type": "error",
"typescript/no-explicit-any": "error",
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-misused-new": "error",
"typescript/no-namespace": "error",
"typescript/no-non-null-asserted-optional-chain": "error",
"typescript/no-require-imports": "error",
"typescript/no-this-alias": "error",
"typescript/no-unnecessary-type-constraint": "error",
"typescript/no-unsafe-declaration-merging": "error",
"typescript/no-unsafe-function-type": "error",
"typescript/no-wrapper-object-types": "error",
"typescript/prefer-as-const": "error",
"typescript/prefer-namespace-keyword": "error",
"typescript/triple-slash-reference": "error"
}
}
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
This project uses Make for builds. Key commands:

- `make build` - Full build (cleans, then builds with tsup (CJS, ESM, `.d.ts`) and webpack (UMD bundle))
- `make lint` - Runs ESLint on `lib`, then `tsc --noEmit` on the source and `tsc -p typings` (React 19 and React 18) on the public typings
- `make lint` - Runs oxlint on `lib`, then `tsc --noEmit` on the source and `tsc -p typings` (React 19 and React 18) on the public typings
- `make test` - Runs unit tests via Vitest
- `make test-browser` - Runs browser tests via Puppeteer (requires build first)
- `make test-all` - Runs both unit and browser tests
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ clean:
mkdir -p build

lint: $(BIN)
@$(BIN)/eslint lib
@$(BIN)/oxlint lib
@$(BIN)/tsc --noEmit
@$(BIN)/tsc -p typings
@$(BIN)/tsc -p typings/tsconfig.react18.json
Expand Down
66 changes: 0 additions & 66 deletions eslint.config.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion lib/Draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class Draggable extends React.Component<Partial<DraggableProps>, DraggableState>
};

if (props.position && !(props.onDrag || props.onStop)) {
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
console.warn('A `position` was applied to this <Draggable>, without drag handlers. This will make this ' +
'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' +
'`position` of this element.');
Expand Down
2 changes: 1 addition & 1 deletion lib/DraggableCore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ export default class DraggableCore extends React.Component<Partial<DraggableCore
// This makes it flexible to use whatever element is wanted (div, ul, etc)
// children is typed as ReactNode for public-API compatibility; Children.only
// throws at runtime unless it is exactly one element, so the cast is safe.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line typescript/no-explicit-any
return React.cloneElement(React.Children.only(this.props.children) as React.ReactElement<any>, {
// Note: mouseMove handler is attached to document so it will still function
// when the user drags quickly and leaves the bounds of the element.
Expand Down
2 changes: 1 addition & 1 deletion lib/umd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// cjs.ts keeps the modern default+named ESM shape for the tsup cjs/esm/dts
// artifacts; this file is consumed only by webpack and is excluded from tsup.

/* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-explicit-any */
/* oxlint-disable typescript/no-require-imports, typescript/no-explicit-any */
const {default: Draggable, DraggableCore} = require('./Draggable') as typeof import('./Draggable');

const root = Draggable as any;
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/log.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*eslint no-console:0*/
/* oxlint-disable no-console */
const log = typeof process !== 'undefined' && process.env.DRAGGABLE_DEBUG ? console.log.bind(console) : function noop(): void {};
export default log;
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,18 @@
},
"homepage": "https://github.com/react-grid-layout/react-draggable",
"devDependencies": {
"@eslint/eslintrc": "^3.3.3",
"@eslint/js": "^9.39.2",
"@testing-library/dom": "^10.4.1",
"@testing-library/react": "^16.3.1",
"@types/node": "^25.0.3",
"@types/prop-types": "^15.7.15",
"@types/react": "^19.2.7",
"@types/react-18": "npm:@types/react@^18.3.27",
"@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
"@vitejs/plugin-react": "^5.1.2",
"@vitest/coverage-v8": "^4.1.11",
"esbuild-loader": "^4.2.2",
"eslint": "^9.39.2",
"eslint-plugin-react": "^7.37.5",
"globals": "^16.5.0",
"jsdom": "^27.4.0",
"oxlint": "^1.93.0",
"playwright": "1.62.1",
"pre-commit": "^1.2.2",
"process": "^0.11.10",
Expand Down
1 change: 0 additions & 1 deletion scripts/verify-build.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ assert.ok(
`Missing CJS build at ${cjsPath} — run \`yarn build\` first.`
);

// eslint-disable-next-line global-require, import/no-dynamic-require
const cjs = require(cjsPath);
assert.equal(
typeof cjs,
Expand Down
1 change: 0 additions & 1 deletion test/utils/shims.extra.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ describe('shims - additional edge cases', () => {

it('returns false for boxed Number objects', () => {
// typeof new Number(1) === 'object'
// eslint-disable-next-line no-new-wrappers
expect(isNum(new Number(1))).toBe(false);
});

Expand Down
Loading
Loading