Skip to content

Commit

Permalink
feat: add some level of intellisense in eslint file
Browse files Browse the repository at this point in the history
  • Loading branch information
sushanyadav committed Nov 1, 2023
1 parent a992a3f commit 6d52a95
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 107 deletions.
63 changes: 33 additions & 30 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/**
* @type {import("eslint").Linter.Config}
*/
module.exports = {
extends: ["plugin:react/recommended", "next/core-web-vitals"],
extends: ['plugin:react/recommended', 'next/core-web-vitals'],
env: { es6: true },
rules: {
"@next/next/no-img-element": "off",
"react/jsx-sort-props": [
'@next/next/no-img-element': 'off',
'react/jsx-sort-props': [
2,
{
callbacksLast: true,
Expand All @@ -12,52 +15,52 @@ module.exports = {
reservedFirst: true,
},
],
"import/order": [
"warn",
'import/order': [
'warn',
{
alphabetize: { order: "asc", caseInsensitive: true },
alphabetize: { order: 'asc', caseInsensitive: true },
pathGroups: [
{
pattern: "@/common/**",
group: "external",
position: "after",
pattern: '@/common/**',
group: 'external',
position: 'after',
},
{
pattern: "@/modules/**",
group: "external",
position: "after",
pattern: '@/modules/**',
group: 'external',
position: 'after',
},
],
"newlines-between": "always",
'newlines-between': 'always',
},
],
"array-callback-return": [
"error",
'array-callback-return': [
'error',
{
checkForEach: true,
},
],
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"react/no-unknown-property": [
"error",
{ ignore: ["css", "global", "jsx"] },
'simple-import-sort/exports': 'error',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'react/no-unknown-property': [
'error',
{ ignore: ['css', 'global', 'jsx'] },
],
},
root: true,
parser: "@typescript-eslint/parser",
parser: '@typescript-eslint/parser',
plugins: [
"@next/next",
"@typescript-eslint",
"react",
"simple-import-sort",
"import",
'@next/next',
'@typescript-eslint',
'react',
'simple-import-sort',
'import',
],
parserOptions: {
project: "./tsconfig.json",
sourceType: "module",
project: './tsconfig.json',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
},
"devDependencies": {
"@tsconfig/next": "^1.0.2",
"@types/eslint": "^8.44.6",
"@types/node": "^17.0.35",
"@types/react": "^18.0.9",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"autoprefixer": "^10.4.14",
"eslint": "^8.35.0",
"eslint": "^8.52.0",
"eslint-config-next": "^13.4.9",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-simple-import-sort": "^10.0.0",
Expand Down
8 changes: 1 addition & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
"@/*": ["src/*"]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.js",
"./**/.*",
],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js", "./**/.*"],
"exclude": ["node_modules"]
}
Loading

0 comments on commit 6d52a95

Please sign in to comment.