Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eslint-plugin-react-hooks): convert to typescript and package type declarations #32240

Merged
8 changes: 8 additions & 0 deletions packages/eslint-plugin-react-hooks/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* This file is purely being used for local jest runs, and doesn't participate in the build process.
*/
'use strict';

module.exports = {
extends: '../../babel.config-ts.js',
};
9 changes: 1 addition & 8 deletions packages/eslint-plugin-react-hooks/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

export * from './src/index';
module.exports = require('./src/index.ts');
8 changes: 8 additions & 0 deletions packages/eslint-plugin-react-hooks/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

process.env.NODE_ENV = 'development';

module.exports = {
setupFiles: [require.resolve('../../scripts/jest/setupEnvironment.js')],
moduleFileExtensions: ['ts', 'js', 'json'],
};
1 change: 1 addition & 0 deletions packages/eslint-plugin-react-hooks/npm/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './cjs/eslint-plugin-react-hooks';
11 changes: 9 additions & 2 deletions packages/eslint-plugin-react-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,26 @@
"files": [
"LICENSE",
"README.md",
"cjs",
"index.js",
"cjs"
"index.d.ts"
],
"keywords": [
"eslint",
"eslint-plugin",
"eslintplugin",
"react"
],
"scripts": {
"test": "jest",
"typecheck": "tsc --noEmit"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/facebook/react/issues"
},
"main": "./index.js",
"types": "./index.d.ts",
"engines": {
"node": ">=10"
},
Expand All @@ -32,6 +39,7 @@
},
"devDependencies": {
"@babel/eslint-parser": "^7.11.4",
"@babel/preset-typescript": "^7.26.0",
"@tsconfig/strictest": "^2.0.5",
"@typescript-eslint/parser-v2": "npm:@typescript-eslint/parser@^2.26.0",
"@typescript-eslint/parser-v3": "npm:@typescript-eslint/parser@^3.10.0",
Expand All @@ -45,7 +53,6 @@
"eslint-v7": "npm:eslint@^7.7.0",
"eslint-v9": "npm:eslint@^9.0.0",
"jest": "^29.5.0",
"tsup": "^8.3.5",
"typescript": "^5.4.3"
}
}
Loading
Loading