-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #354 from belgattitude/improved-eslint
Improved eslint config
- Loading branch information
Showing
60 changed files
with
349 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
'blog-app': patch | ||
'web-app': patch | ||
'@your-org/core-lib': patch | ||
'@your-org/db-main-prisma': patch | ||
'@your-org/ui-lib': patch | ||
--- | ||
|
||
Improve eslint config and add eslint-plugin-import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true, | ||
es6: true, | ||
}, | ||
ignorePatterns: ['node_modules/*'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 12, | ||
sourceType: 'module', | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
'import/resolver': { | ||
typescript: {}, | ||
}, | ||
}, | ||
extends: [ | ||
'plugin:import/errors', | ||
'plugin:import/warnings', | ||
'plugin:import/typescript', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended', | ||
'plugin:jest/recommended', | ||
'plugin:sonarjs/recommended', | ||
], | ||
globals: { | ||
context: 'readonly', | ||
cy: 'readonly', | ||
assert: 'readonly', | ||
Cypress: 'readonly', | ||
}, | ||
rules: { | ||
'linebreak-style': ['error', 'unix'], | ||
'import/default': 'off', | ||
'import/no-named-as-default-member': 'off', | ||
'import/no-named-as-default': 'off', | ||
'import/order': [ | ||
'error', | ||
{ | ||
groups: [ | ||
'builtin', | ||
'external', | ||
'internal', | ||
'parent', | ||
'sibling', | ||
'index', | ||
'object', | ||
], | ||
alphabetize: { order: 'asc', caseInsensitive: true }, | ||
}, | ||
], | ||
'no-empty-function': 'off', | ||
'@typescript-eslint/no-empty-function': [ | ||
'error', | ||
{ allow: ['private-constructors'] }, | ||
], | ||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.config.js', '**/jest/**/*.js'], | ||
parser: 'espree', | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'sonarjs/no-duplicate-string': 'off', | ||
'sonarjs/no-all-duplicated-branches': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['*.test.ts', '*.test.tsx'], | ||
rules: { | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-object-literal-type-assertion': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
module.exports = { | ||
root: true, | ||
ignorePatterns: ['node_modules/*', '.next'], | ||
extends: [ | ||
'../../.eslintrc.base.js', | ||
// Add specific rules for react and nextjs | ||
'plugin:react/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:jsx-a11y/recommended', | ||
'plugin:@next/next/recommended', | ||
'plugin:testing-library/react', | ||
], | ||
env: { | ||
browser: true, | ||
es6: true, | ||
node: true, | ||
}, | ||
rules: { | ||
'react/prop-types': 'off', | ||
'react/react-in-jsx-scope': 'off', | ||
'jsx-a11y/anchor-is-valid': 'off', | ||
'react/no-unescaped-entities': 'off', | ||
|
||
// next/image might not be yet a good move as of NextJs v11. | ||
// https://github.com/vercel/next.js/discussions/16832 | ||
'@next/next/no-img-element': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['next.config.js'], | ||
parser: 'espree', | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
}, | ||
rules: { | ||
'import/order': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['src/pages/**/*.ts', 'src/pages/**/*.tsx'], | ||
rules: { | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['src/backend/api/**/*.ts'], | ||
rules: { | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['config/jest/test-utils.tsx'], | ||
rules: { | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'import/export': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/blog-app/src/components/layout/__tests__/main-layout.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
4b18254
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nextjs-monorepo-example-web-app – ./apps/web-app
nextjs-monorepo-example-web-app-belgattitude.vercel.app
nextjs-monorepo-example-web-app-git-main-belgattitude.vercel.app
nextjs-monorepo-example-web-app.vercel.app
4b18254
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nextjs-monorepo-example-blog-app – ./apps/blog-app
nextjs-monorepo-example-blog-app-belgattitude.vercel.app
nextjs-monorepo-example-blog-app-git-main-belgattitude.vercel.app
nextjs-monorepo-example-blog-app.vercel.app