Skip to content

Commit

Permalink
add eslint rule to disable relative import outside of same folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan-Y-Ko committed Sep 12, 2023
1 parent a8eb5d7 commit 0cc6c58
Showing 3 changed files with 13 additions and 44 deletions.
52 changes: 11 additions & 41 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -8,11 +8,7 @@
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"import",
"no-relative-import-paths"
],
"plugins": ["@typescript-eslint", "import", "no-relative-import-paths"],
"extends": [
"plugin:import/recommended",
"plugin:import/typescript",
@@ -32,9 +28,7 @@
"error",
{
"selector": "interface",
"format": [
"PascalCase"
]
"format": ["PascalCase"]
}
],
"react/function-component-definition": [
@@ -43,10 +37,7 @@
"namedComponents": "function-declaration"
}
],
"react/destructuring-assignment": [
2,
"always"
],
"react/destructuring-assignment": [2, "always"],
"react/button-has-type": 2,
"react/no-array-index-key": 2,
"import/order": 2,
@@ -56,14 +47,8 @@
"allowSameFolder": true
}
],
"semi": [
2,
"always"
],
"quotes": [
2,
"double"
],
"semi": [2, "always"],
"quotes": [2, "double"],
"prefer-destructuring": [
2,
{
@@ -80,18 +65,9 @@
"enforceForRenamedProperties": false
}
],
"object-curly-spacing": [
2,
"always"
],
"arrow-body-style": [
2,
"as-needed"
],
"arrow-parens": [
2,
"always"
],
"object-curly-spacing": [2, "always"],
"arrow-body-style": [2, "as-needed"],
"arrow-parens": [2, "always"],
"space-infix-ops": 2,
"arrow-spacing": [
2,
@@ -109,16 +85,10 @@
],
"guard-for-in": 2,
"no-await-in-loop": 2,
"indent": [
2,
2
],
"indent": [2, 2],
"brace-style": 2,
"no-multiple-empty-lines": 2,
"eol-last": [
2,
"always"
],
"eol-last": [2, "always"],
"no-nested-ternary": 2
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -47,4 +47,4 @@
"tailwindcss": "3.3.3",
"typescript": "5.1.6"
}
}
}
3 changes: 1 addition & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import "./globals.css";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import { StoreProvider } from "@/components";
import Navbar from '../components/navbar/Navbar'
import { StoreProvider, Navbar } from "@/components";

export const metadata: Metadata = {
title: "Create Next App",

0 comments on commit 0cc6c58

Please sign in to comment.