Skip to content

Commit

Permalink
chore: upgrade to eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Oct 24, 2024
1 parent a8edce7 commit 1b4f274
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 83 deletions.
55 changes: 0 additions & 55 deletions common/.eslintrc.json

This file was deleted.

68 changes: 68 additions & 0 deletions common/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import eslint from "@eslint/js";
// @if babel
import babelParser from "@babel/eslint-parser";
// @endif
// @if typescript
import tseslint from 'typescript-eslint';
import tsParser from "@typescript-eslint/parser";
// @endif
import globals from "globals";

export default [
eslint.configs.recommended,
// @if typescript
...tseslint.configs.recommended,
// @endif
{
root: true,
// @if typescript
files: ["**/*.ts"],
// @endif

rules: {
"no-unused-vars": 0,
// @if typescript
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-explicit-any": 0,
// @endif
"no-prototype-builtins": 0,
"no-console": 0,
"getter-return": 0
},

languageOptions: {
globals: {
...globals.builtin,
...globals.nodeBuiltin,
...globals.browser,
...globals.node,
// @if karma
...globals.jasmine,
// @endif
// @if jest
...globals.jest,
// @endif
},

// @if babel
parser: babelParser,
// @endif
// @if typescript
parser: tsParser,
// @endif
ecmaVersion: 2019,
sourceType: "module",
parserOptions: {
// @if babel
ecmaFeatures: {
legacyDecorators: true
},
// @endif
// @if typescript
project: "./tsconfig.json",
tsconfigRootDir: ".",
// @endif
},
},
}
];
16 changes: 8 additions & 8 deletions common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
},
// @endif
"devDependencies": {
"eslint": "^8.43.0",
"eslint": "^9.13.0",
"globals": "^15.10.0",
"aurelia-cli": "^3.0.3",
"aurelia-testing": "^1.1.0",
"gulp": "^4.0.2",
Expand All @@ -28,21 +29,20 @@
// @endif

// @if babel
"@babel/eslint-parser": "^7.25.8",
"@babel/plugin-proposal-decorators": "^7.25.7",
"@babel/eslint-parser": "^7.25.9",
"@babel/plugin-proposal-decorators": "^7.25.9",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.25.8",
"@babel/preset-env": "^7.25.9",
"@babel/core": "^7.25.8",
"@babel/register": "^7.25.7",
"@babel/register": "^7.25.9",
"regenerator-runtime": "^0.14.1",
// @endif

// @if typescript
"typescript": "^5.6.3",
"tslib": "^2.8.0",
"@types/node": "^22.7.8",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^8.11.0",
"@types/node": "^22.7.9",
"typescript-eslint": "^8.8.1",
// @endif
},
// @if postcss || babel
Expand Down
2 changes: 1 addition & 1 deletion jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// @if typescript
"ts-jest": "^29.2.5",
"@types/jest": "^29.5.13",
"@types/jest": "^29.5.14",
// @endif
},
"scripts": {
Expand Down
5 changes: 0 additions & 5 deletions plugin/test__if_karma_or_jest/unit/.eslintrc__if_babel

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {StageComponent} from 'aurelia-testing';
import {bootstrap} from 'aurelia-bootstrapper';

function fireEvent(el, type, options) {
var o = options || {};
var e = document.createEvent('Event');
const o = options || {};
const e = document.createEvent('Event');
e.initEvent(type, true, true);
Object.keys(o).forEach(apply);
el.dispatchEvent(e);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Users} from '../../src/users';

class HttpStub {
fetch(url) {
var response = this.itemStub;
const response = this.itemStub;
this.url = url;
return new Promise((resolve) => {
resolve({ json: () => response });
Expand All @@ -14,10 +14,10 @@ class HttpStub {

describe('the Users module', () => {
it('sets fetch response to users', async () => {
var http = new HttpStub();
var sut = new Users(http);
var itemStubs = [1];
var itemFake = [2];
const http = new HttpStub();
const sut = new Users(http);
const itemStubs = [1];
const itemFake = [2];

http.itemStub = itemStubs;
await sut.activate();
Expand Down
4 changes: 2 additions & 2 deletions webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@

// @if sass
"sass-loader": "^16.0.2",
"sass": "^1.80.3",
"sass": "^1.80.4",
// @endif

// @if stylus
"stylus-loader": "^8.1.1",
"stylus": "^0.64.0",
// @endif

"html-webpack-plugin": "^5.6.2",
"html-webpack-plugin": "^5.6.3",
"copy-webpack-plugin": "^12.0.2",
"mini-css-extract-plugin": "^2.9.1",
"aurelia-webpack-plugin": "^5.0.6",
Expand Down

0 comments on commit 1b4f274

Please sign in to comment.