@andrewt03/eslint-typescript-rules 0.0.57 → 0.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +4 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -169,7 +169,7 @@ module.exports = [
169
169
 
170
170
  #### Alternative - `ESModules`
171
171
 
172
- - **Note:** In `ESModules`, the `__dirname` variable is not available. As a fix, in most cases, we can leverage `process.cwd()` in this case since the `ESLint` file configuration is typically written at the top-level of a project. However, if this does not work, some alternatives can be found in this [StackOverflow](https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules) post.
172
+ - **Note:** In `ESModules`, the `__dirname` variable is not available. As a fix, in most cases, we can leverage `import.meta.dirname` or `process.cwd()` in this case since the `ESLint` file configuration is typically written at the top-level of a project. However, if this does not work, some alternatives can be found in this [StackOverflow](https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules) post.
173
173
 
174
174
  ---
175
175
 
@@ -185,6 +185,8 @@ import angularEslintPlugin from "@angular-eslint/eslint-plugin";
185
185
  import eslintReactPlugin from "eslint-plugin-react";
186
186
  import eslintReactHooksPlugin from "eslint-plugin-react-hooks";
187
187
 
188
+ const DIR_NAME = import.meta.dirname;
189
+
188
190
  export default [
189
191
  {
190
192
  ignores: ["**/dist"]
@@ -204,7 +206,7 @@ export default [
204
206
  parser: tseslint.parser,
205
207
  parserOptions: {
206
208
  projectService: true,
207
- tsconfigRootDir: process.cwd(),
209
+ tsconfigRootDir: DIR_NAME,
208
210
 
209
211
  // React-Specific (Omit if not necessary)
210
212
  ecmaFeatures: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrewt03/eslint-typescript-rules",
3
- "version": "0.0.57",
3
+ "version": "0.0.58",
4
4
  "description": "Recommended ESLint Rules for general TypeScript, Node.js/Express.js, Angular, and React.js Projects",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",