-
Notifications
You must be signed in to change notification settings - Fork 746
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update highlight-js to eslint 9.0 (#15092)
eslint 9 has breaking changes, and also eslint-plugin-header doesn't work with it. See https://eslint.org/docs/latest/use/configure/migration-guide#migrate-your-config-file This also creates a src\copyright-template.js file which can be used by all eslint.config.mjs files when other pieces are updated. ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/15092)
- Loading branch information
1 parent
384f3b0
commit ba77f3b
Showing
7 changed files
with
415 additions
and
279 deletions.
There are no files selected for viewing
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,2 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. |
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,60 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import notice from "eslint-plugin-notice"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
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/**/*"], | ||
}, ...compat.extends("eslint:recommended"), { | ||
plugins: { | ||
notice, | ||
}, | ||
|
||
languageOptions: { | ||
parser: tsParser, | ||
ecmaVersion: 2020, | ||
sourceType: "module", | ||
|
||
parserOptions: { | ||
project: "./tsconfig.json", | ||
}, | ||
}, | ||
|
||
rules: { | ||
"notice/notice": [ | ||
2, | ||
{ | ||
"templateFile": "../copyright-template.js", | ||
} | ||
] | ||
} | ||
}, ...compat.extends("plugin:@typescript-eslint/recommended", "plugin:jest/all").map(config => ({ | ||
...config, | ||
files: ["**/*.ts"], | ||
})), { | ||
files: ["**/*.ts"], | ||
|
||
|
||
}, { | ||
files: ["**/*.js"], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
}]; |
Oops, something went wrong.