Skip to content

Commit

Permalink
Update ESLint (#597)
Browse files Browse the repository at this point in the history
* Remove Azure Accounts dependency & delete configure flow

* Don't bring in a new package for one API call

* Update to ESLint flat config

* Enable stylistic

* And update TypeScript too

* Update back up to test-electron 2.4.1
  • Loading branch information
winstliu authored Dec 3, 2024
1 parent 6e88138 commit a28725b
Show file tree
Hide file tree
Showing 14 changed files with 734 additions and 940 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

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

This file was deleted.

7 changes: 5 additions & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
.gitattributes
.gitignore
.npmrc
.vscode-test.mjs
eslint.config.mjs
tsconfig.json
tslint.json
webpack.config.js
tsconfig.test.json
webpack.config.mjs
.azure-pipelines/
.github/
.vscode/
.vscode-test/
coverage/
Expand Down
43 changes: 43 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
ignores: [
'.azure-pipelines/',
'.vscode-test/',
'dist/',
'out/',
],
},
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['*.?(m)js'],
},
tsconfigRootDir: import.meta.dirname,
}
},
rules: {
// Allow numbers and booleans in template expressions
'@typescript-eslint/restrict-template-expressions': ['error', {
allowNumber: true,
allowBoolean: true,
}],
// Always use `return await` in async functions
'@typescript-eslint/return-await': ['error', 'always'],
// Prefer using String.match
'@typescript-eslint/prefer-regexp-exec': 'off',
},
},
{
files: ['**/*.?(m)js'],
extends: [tseslint.configs.disableTypeChecked],
},
);
Loading

0 comments on commit a28725b

Please sign in to comment.