Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,6 @@ dist/lib/dlls/**/*

*.d.ts.map
*.js
!eslint.config.js
coverage/
dlls/
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.json
*.md
*.jsonc
.prettierrc
azure-pipelines.yml
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cSpell.words": [
"yzhang"
]
],
"azure-pipelines.1ESPipelineTemplatesSchemaFile": true
Comment thread
konrad-jamrozik marked this conversation as resolved.
}
4 changes: 4 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ pool:
steps:
- script: npm ci
displayName: npm ci
- script: npm run lint
displayName: lint
- script: npm run prettier
displayName: prettier
- script: npm test
displayName: test
- script: npm pack
Expand Down
51 changes: 51 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// @ts-check

// This file contents based on:
// https://typescript-eslint.io/getting-started#step-2-configuration
// https://typescript-eslint.io/getting-started/typed-linting

import eslint from "@eslint/js"
import { dirname } from "path"
import tseslint from "typescript-eslint"
import { fileURLToPath } from "url"

// Needed to support Node < 20.11 per:
// https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules
// as linked from: https://typescript-eslint.io/getting-started/typed-linting
const __dirname = dirname(fileURLToPath(import.meta.url))

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: __dirname
}
}
},
{
// Based on https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
ignores: ["**/dist"]
},
{
rules: {
// Rules disabled as part of migration from tslint
// https://github.com/Azure/openapi-diff/pull/335
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"no-constant-condition": "off",
"no-useless-escape": "off",
"prefer-const": "off"
}
}
)
Loading