Skip to content

Commit

Permalink
Merge pull request #150 from poap-xyz/upgrade-eslint-minor
Browse files Browse the repository at this point in the history
Upgrade Eslint
  • Loading branch information
jm42 authored Nov 27, 2024
2 parents b387ccb + 804d843 commit 728bd38
Show file tree
Hide file tree
Showing 5 changed files with 1,106 additions and 409 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

57 changes: 0 additions & 57 deletions .eslintrc.js

This file was deleted.

104 changes: 104 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import globals from 'globals';
import path from 'node:path';
import url from 'node:url';
import js from '@eslint/js';
import tsParser from '@typescript-eslint/parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: [
'./dist/',
'**/dist/',
'**/node_modules/',
],
},
...compat.extends(
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
),
{
plugins: {
'@typescript-eslint': tsPlugin,
},

languageOptions: {
globals: {
...globals.node,
...globals.jest,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: 'module',

parserOptions: {
project: 'tsconfig.json',
},
},

rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-function-return-type': ['error'],
'@typescript-eslint/explicit-module-boundary-types': ['error'],
'@typescript-eslint/no-explicit-any': ['error'],
'@typescript-eslint/prefer-as-const': ['error'],
'@typescript-eslint/restrict-plus-operands': ['error'],
'@typescript-eslint/await-thenable': ['error'],
'@typescript-eslint/no-floating-promises': ['error'],
'@typescript-eslint/no-misused-promises': ['error'],
'@typescript-eslint/no-unused-vars': ['error'],

complexity: ['error', 5],

'max-len': [
'error',
{
code: 200,
ignorePattern: '^import |^export ',
},
],

'max-statements': ['error', 10],
},
},
{
files: ['packages/*/src/**/*.ts'],

languageOptions: {
ecmaVersion: 5,
sourceType: 'script',

parserOptions: {
project: [
'./packages/moments/tsconfig.json',
'./packages/drops/tsconfig.json',
'./packages/providers/tsconfig.json',
'./packages/utils/tsconfig.json',
'./packages/poaps/tsconfig.json',
'./packages/frames/tsconfig.json',
'./tsconfig.json',
],
},
},
},
{
files: ['**/*.spec.ts'],

rules: {
'max-lines-per-function': 'off',
'max-statements': 'off',
},
},
];
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,22 @@
},
"homepage": "https://github.com/poap-xyz/poap.js#readme",
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@types/jest": "^29.5.11",
"@types/node": "^20.11.10",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"eslint": "^8.56.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.16.0",
"eslint": "^9.15.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.12.0",
"jest": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"jest-mock-extended": "^3.0.5",
Expand Down
Loading

0 comments on commit 728bd38

Please sign in to comment.