Skip to content

Commit 9f80573

Browse files
B4nanvladfrangu
andauthored
chore: update eslint to v9 (#635)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
1 parent 54a0742 commit 9f80573

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1886
-4570
lines changed

.eslintrc.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/scripts/before-beta-release.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
const path = require('path');
2-
const fs = require('fs');
31
const { execSync } = require('child_process');
2+
const fs = require('fs');
3+
const path = require('path');
44

55
const PKG_JSON_PATH = path.join(__dirname, '..', '..', 'package.json');
66

7+
// eslint-disable-next-line import/no-dynamic-require
78
const pkgJson = require(PKG_JSON_PATH);
89

910
const PACKAGE_NAME = pkgJson.name;
@@ -13,7 +14,7 @@ const nextVersion = getNextVersion(VERSION);
1314
console.log(`before-deploy: Setting version to ${nextVersion}`);
1415
pkgJson.version = nextVersion;
1516

16-
fs.writeFileSync(PKG_JSON_PATH, JSON.stringify(pkgJson, null, 2) + '\n');
17+
fs.writeFileSync(PKG_JSON_PATH, `${JSON.stringify(pkgJson, null, 2)}\n`);
1718

1819
function getNextVersion(version) {
1920
const versionString = execSync(`npm show ${PACKAGE_NAME} versions --json`, { encoding: 'utf8'});

eslint.config.mjs

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import tsStylistic from '@stylistic/eslint-plugin-ts';
2+
import prettier from 'eslint-config-prettier';
3+
import globals from 'globals';
4+
import tsEslint from 'typescript-eslint';
5+
6+
import apify from '@apify/eslint-config';
7+
8+
export default [
9+
{
10+
ignores: ['**/dist', 'node_modules', 'coverage', 'website', '**/*.d.ts'],
11+
},
12+
...apify,
13+
prettier,
14+
{
15+
languageOptions: {
16+
parser: tsEslint.parser,
17+
parserOptions: {
18+
project: 'tsconfig.eslint.json',
19+
},
20+
globals: {
21+
...globals.browser,
22+
...globals.node,
23+
...globals.jest,
24+
},
25+
},
26+
},
27+
{
28+
plugins: {
29+
'@typescript-eslint': tsEslint.plugin,
30+
'@stylistic': tsStylistic,
31+
},
32+
rules: {
33+
'@typescript-eslint/no-empty-object-type': 'off',
34+
'@typescript-eslint/no-explicit-any': 'off',
35+
'max-classes-per-file': 'off',
36+
'no-empty-function': 'off',
37+
'consistent-return': 'off',
38+
'no-use-before-define': 'off',
39+
'no-param-reassign': 'off',
40+
'no-void': 'off',
41+
'no-underscore-dangle': 'off',
42+
'no-console': 'off',
43+
'import/no-extraneous-dependencies': 'off',
44+
'import/extensions': 'off',
45+
'import/no-default-export': 'off',
46+
'@typescript-eslint/array-type': 'error',
47+
'@typescript-eslint/ban-ts-comment': 0,
48+
'@typescript-eslint/consistent-type-imports': [
49+
'error',
50+
{
51+
'disallowTypeAnnotations': false,
52+
},
53+
],
54+
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
55+
'@stylistic/member-delimiter-style': [
56+
'error',
57+
{
58+
'multiline': { 'delimiter': 'semi', 'requireLast': true },
59+
'singleline': { 'delimiter': 'semi', 'requireLast': false },
60+
},
61+
],
62+
'@typescript-eslint/no-empty-interface': 'off',
63+
'@typescript-eslint/promise-function-async': 'off',
64+
'no-promise-executor-return': 'off',
65+
'@typescript-eslint/prefer-destructuring': 'off',
66+
'prefer-destructuring': 'off',
67+
'@typescript-eslint/no-empty-function': 'off',
68+
'@typescript-eslint/no-floating-promises': 'error',
69+
'@typescript-eslint/no-unused-vars': 'off',
70+
'@stylistic/comma-dangle': ['error', 'always-multiline'],
71+
},
72+
},
73+
{
74+
files: ['packages/templates/**/*'],
75+
rules: {
76+
'no-unused-vars': 'off',
77+
'@typescript-eslint/no-unused-vars': 'off',
78+
},
79+
},
80+
];

0 commit comments

Comments
 (0)