Skip to content

Commit

Permalink
Add eslint rule to restrict relative imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
programmiri committed Oct 25, 2022
1 parent c82b477 commit b2d08f6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion coral/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ module.exports = {
},
"plugins": [
"react",
"@typescript-eslint"
"@typescript-eslint",
"no-relative-import-paths"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"no-relative-import-paths/no-relative-import-paths": [
"warn",
{ "allowSameFolder": true, "rootDir": "src" }
]
}
}
1 change: 1 addition & 0 deletions coral/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@vitejs/plugin-react": "^2.1.0",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-no-relative-import-paths": "^1.4.0",
"eslint-plugin-react": "^7.31.10",
"husky": "^8.0.1",
"identity-obj-proxy": "^3.0.0",
Expand Down
6 changes: 6 additions & 0 deletions coral/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion coral/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App from "./App";
import App from "@/App";
import { render, screen } from "@testing-library/react";

describe("App.tsx", () => {
Expand Down

0 comments on commit b2d08f6

Please sign in to comment.