Skip to content

Commit

Permalink
feat(eslint plugin): added support for eslint-plugin-next
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaPontrandolfo committed Oct 2, 2022
1 parent 6b41b03 commit 76ec94b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
20 changes: 15 additions & 5 deletions configs/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const playwright = require('eslint-plugin-playwright');
const jsdoc = require('eslint-plugin-jsdoc');
const pluginImport = require('eslint-plugin-import');
const lodash = require('eslint-plugin-lodash-f');
const nextjs = require('@next/eslint-plugin-next');
console.log('🚀 ~ file: eslint.config.js ~ line 13 ~ nextjs', nextjs);
const prettierConfig = require('eslint-config-prettier');

const messages = {
Expand All @@ -24,11 +26,6 @@ const baseEslintHandPickedRules = {
// TODO
// curly: error,
// quotes: [error, 'backtick', { avoidEscape: false }],
// semi: [error, 'always'],
// 'comma-dangle': [error, 'always-multiline'],
// 'semi-style': [error, 'last'],
// 'space-infix-ops': [error, { int32Hint: false }],
// 'new-parens': 2,
// 'no-else-return': [error, { allowElseIf: false }],
// 'object-shorthand': [error, 'properties'],
// 'prefer-const': [warning, { ignoreReadBeforeAssign: false }],
Expand Down Expand Up @@ -428,6 +425,7 @@ module.exports = [
},
},
},
// TODO requires the sheriff.config.js file
{
files: ['**/*{js,ts,jsx,tsx}'],
plugins: {
Expand All @@ -438,6 +436,18 @@ module.exports = [
...lodashHandPickedRules,
},
},
// TODO requires the sheriff.config.js file
// {
// files: ['**/*{js,ts,jsx,tsx}'],
// plugins: {
// '@next/next': nextjs,
// },
// rules: {
// ...nextjs.configs.recommended.rules,
// ...nextjs.configs['core-web-vitals'].rules,
// },
// },
// TODO requires the sheriff.config.js file
{
files: ['**/*{js,ts}'],
plugins: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"semantic-release": "semantic-release"
},
"dependencies": {
"@next/eslint-plugin-next": "^12.3.1",
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"eslint": "^8.23.0",
Expand Down
19 changes: 19 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 76ec94b

Please sign in to comment.