Skip to content

Commit

Permalink
chore: update eslint to v9 (#635)
Browse files Browse the repository at this point in the history
Co-authored-by: Vlad Frangu <[email protected]>
  • Loading branch information
B4nan and vladfrangu authored Feb 11, 2025
1 parent 54a0742 commit 9f80573
Show file tree
Hide file tree
Showing 51 changed files with 1,886 additions and 4,570 deletions.
22 changes: 0 additions & 22 deletions .eslintrc.json

This file was deleted.

7 changes: 4 additions & 3 deletions .github/scripts/before-beta-release.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const path = require('path');
const fs = require('fs');
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');

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

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

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

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

function getNextVersion(version) {
const versionString = execSync(`npm show ${PACKAGE_NAME} versions --json`, { encoding: 'utf8'});
Expand Down
80 changes: 80 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import tsStylistic from '@stylistic/eslint-plugin-ts';
import prettier from 'eslint-config-prettier';
import globals from 'globals';
import tsEslint from 'typescript-eslint';

import apify from '@apify/eslint-config';

export default [
{
ignores: ['**/dist', 'node_modules', 'coverage', 'website', '**/*.d.ts'],
},
...apify,
prettier,
{
languageOptions: {
parser: tsEslint.parser,
parserOptions: {
project: 'tsconfig.eslint.json',
},
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},
},
},
{
plugins: {
'@typescript-eslint': tsEslint.plugin,
'@stylistic': tsStylistic,
},
rules: {
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'max-classes-per-file': 'off',
'no-empty-function': 'off',
'consistent-return': 'off',
'no-use-before-define': 'off',
'no-param-reassign': 'off',
'no-void': 'off',
'no-underscore-dangle': 'off',
'no-console': 'off',
'import/no-extraneous-dependencies': 'off',
'import/extensions': 'off',
'import/no-default-export': 'off',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/consistent-type-imports': [
'error',
{
'disallowTypeAnnotations': false,
},
],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@stylistic/member-delimiter-style': [
'error',
{
'multiline': { 'delimiter': 'semi', 'requireLast': true },
'singleline': { 'delimiter': 'semi', 'requireLast': false },
},
],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/promise-function-async': 'off',
'no-promise-executor-return': 'off',
'@typescript-eslint/prefer-destructuring': 'off',
'prefer-destructuring': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'@stylistic/comma-dangle': ['error', 'always-multiline'],
},
},
{
files: ['packages/templates/**/*'],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
];
Loading

0 comments on commit 9f80573

Please sign in to comment.