Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Sep 23, 2024
1 parent c46cfd8 commit 69c38f9
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 11 deletions.
10 changes: 10 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import base from '@metamask/eslint-config';
// eslint-disable-next-line no-shadow
import jest from '@metamask/eslint-config-jest';
import nodejs from '@metamask/eslint-config-nodejs';
import typescript from '@metamask/eslint-config-typescript';

/**
* @type {import('eslint').Linter.Config[]}
Expand All @@ -19,8 +20,17 @@ const config = [
...nodejs,
...jest,

// This is the recommended way to apply a config array to a subset of files:
// https://eslint.org/docs/latest/use/configure/combine-configs#apply-a-config-array-to-a-subset-of-files
...typescript.map((typeScriptConfig) => ({
files: ['**/*.d.mts'],
...typeScriptConfig,
})),

{
name: 'main',
files: ['**/*.js', '**/*.mjs'],

languageOptions: {
ecmaVersion: 2022,

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@metamask/eslint-config": "^13.0.0",
"@metamask/eslint-config-jest": "workspace:^",
"@metamask/eslint-config-nodejs": "^13.0.0",
"@metamask/eslint-config-typescript": "workspace:^",
"@metamask/utils": "^9.1.0",
"@types/eslint__js": "^8.42.3",
"@types/jest": "^29.5.12",
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/index.d.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module '@metamask/eslint-config' {
import { Linter } from 'eslint';
import type { Linter } from 'eslint';

const config: Linter.Config[];
export default config;
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/index.d.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module '@metamask/eslint-config-browser' {
import { Linter } from 'eslint';
import type { Linter } from 'eslint';

const config: Linter.Config[];
export default config;
Expand Down
2 changes: 1 addition & 1 deletion packages/commonjs/src/index.d.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module '@metamask/eslint-config-commonjs' {
import { Linter } from 'eslint';
import type { Linter } from 'eslint';

const config: Linter.Config[];
export default config;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest/src/index.d.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module '@metamask/eslint-config-jest' {
import { Linter } from 'eslint';
import type { Linter } from 'eslint';

const config: Linter.Config[];
export default config;
Expand Down
2 changes: 1 addition & 1 deletion packages/mocha/src/index.d.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module '@metamask/eslint-config-mocha' {
import { Linter } from 'eslint';
import type { Linter } from 'eslint';

const config: Linter.Config[];
export default config;
Expand Down
2 changes: 1 addition & 1 deletion packages/nodejs/src/index.d.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module '@metamask/eslint-config-nodejs' {
import { Linter } from 'eslint';
import type { Linter } from 'eslint';

const config: Linter.Config[];
export default config;
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript/src/index.d.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module '@metamask/eslint-config-typescript' {
import { Linter } from 'eslint';
import type { Linter } from 'eslint';

const config: Linter.Config[];
export default config;
Expand Down
4 changes: 1 addition & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
"strict": true,
"target": "ES2022"
},
"include": [
"**/*.mjs",
],
"include": ["**/*.mjs", "**/*.mts"],
"exclude": ["./dist", "**/node_modules"]
}
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ __metadata:
languageName: unknown
linkType: soft

"@metamask/eslint-config-typescript@workspace:packages/typescript":
"@metamask/eslint-config-typescript@workspace:^, @metamask/eslint-config-typescript@workspace:packages/typescript":
version: 0.0.0-use.local
resolution: "@metamask/eslint-config-typescript@workspace:packages/typescript"
dependencies:
Expand Down Expand Up @@ -4891,6 +4891,7 @@ __metadata:
"@metamask/eslint-config": ^13.0.0
"@metamask/eslint-config-jest": "workspace:^"
"@metamask/eslint-config-nodejs": ^13.0.0
"@metamask/eslint-config-typescript": "workspace:^"
"@metamask/utils": ^9.1.0
"@types/eslint__js": ^8.42.3
"@types/jest": ^29.5.12
Expand Down

0 comments on commit 69c38f9

Please sign in to comment.