mirror of
https://github.com/appium/appium.git
synced 2026-10-23 00:59:18 +08:00
43df77f6b6
BREAKING CHANGE: This makes `@appium/eslint-config-appium-ts` also apply to JS sources _and_ requires a new peer dependency (`eslint-import-resolver-typescript`). The `main` file is now a `.js` file. The module is expected to _extend_ `@appium/eslint-config-appium`, not replace it; consumers needn't extend both in their ESLint config. In the not-too-distant past, `@typescript-eslint/parser` was unable to understand docstrings in `.js` files. Evidently this is no longer true. I've rewritten and heavily commented the configuration explaining the intent behind everything.
61 lines
1.8 KiB
Plaintext
61 lines
1.8 KiB
Plaintext
{
|
|
"extends": ["@appium/eslint-config-appium-ts"],
|
|
"overrides": [
|
|
{
|
|
"files": "packages/fake-driver/**/*",
|
|
"rules": {"require-await": "off"}
|
|
},
|
|
{"files": "packages/support/**/*", "globals": {"BigInt": "readonly"}},
|
|
{
|
|
"files": "packages/*/test/**/*",
|
|
"rules": {"func-names": "off"}
|
|
},
|
|
{
|
|
"files": ["packages/*/index.js", "packages/*/scripts/**/*.js", "test/*.js"],
|
|
"parserOptions": {
|
|
"sourceType": "script"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"packages/appium/support.js",
|
|
"packages/appium/driver.js",
|
|
"packages/appium/plugin.js"
|
|
],
|
|
"parserOptions": {
|
|
"sourceType": "script"
|
|
}
|
|
},
|
|
{
|
|
"files": ["./test/setup.js", "./**/scripts/**/*.js", "./packages/*/index.js"],
|
|
"rules": {
|
|
"@typescript-eslint/no-var-requires": "off"
|
|
}
|
|
},
|
|
{
|
|
"files": "./packages/*/test/**/*.js",
|
|
"rules": {
|
|
"@typescript-eslint/no-var-requires": "off",
|
|
"no-restricted-properties": [
|
|
"error",
|
|
{
|
|
"object": "sinon",
|
|
"property": "spy",
|
|
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.spy()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
|
|
},
|
|
{
|
|
"object": "sinon",
|
|
"property": "stub",
|
|
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.stub()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
|
|
},
|
|
{
|
|
"object": "sinon",
|
|
"property": "mock",
|
|
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.mock()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|