-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.eslintrc.js and .eslintignore are deprecated and the new flat config system is preferred. The CLI also doesn't support --ext flag with the flat config system. How the new config is generated: https://eslint.org/docs/latest/use/configure/migration-guide#migrate-your-config-file Reference for cli flag changes: https://eslint.org/docs/latest/use/configure/migration-guide#cli-flag-changes
- Loading branch information
1 parent
19a0cc1
commit 1c545dc
Showing
4 changed files
with
76 additions
and
46 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import header from "eslint-plugin-header"; | ||
import globals from "globals"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all, | ||
}); | ||
|
||
export default [ | ||
{ | ||
ignores: [ | ||
"**/out", | ||
"**/poky", | ||
"**/.vscode-test", | ||
"__mocks__/vscode.ts", | ||
"**/jest.config.js", | ||
"**/eslint.config.mjs", | ||
], | ||
}, | ||
...compat.extends( | ||
"standard-with-typescript", | ||
"plugin:deprecation/recommended" | ||
), | ||
{ | ||
plugins: { | ||
header, | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
}, | ||
|
||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
}, | ||
|
||
rules: { | ||
"header/header": [ | ||
2, | ||
"block", | ||
[ | ||
" --------------------------------------------------------------------------------------------", | ||
{ | ||
pattern: " \\* Copyright \\(c\\) .*\\. All rights reserved\\.", | ||
template: | ||
" * Copyright (c) 2023 Savoir-faire Linux. All rights reserved.", | ||
}, | ||
" * Licensed under the MIT License. See License.txt in the project root for license information.", | ||
" * ------------------------------------------------------------------------------------------ ", | ||
], | ||
2, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ["**/*.ts"], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
|
||
ecmaVersion: 5, | ||
sourceType: "commonjs", | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters