mirror of
https://github.com/jesse-r-s-hines/obsidian-open-tab-settings.git
synced 2026-07-22 05:43:41 +00:00
Set up obsidian eslint
This commit is contained in:
parent
ce42eb7003
commit
6127035e8f
4 changed files with 1244 additions and 74 deletions
23
.eslintrc
23
.eslintrc
|
|
@ -1,23 +0,0 @@
|
||||||
{
|
|
||||||
"root": true,
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"env": { "node": true },
|
|
||||||
"plugins": [
|
|
||||||
"@typescript-eslint"
|
|
||||||
],
|
|
||||||
"extends": [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
|
||||||
"sourceType": "module"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"no-unused-vars": "off",
|
|
||||||
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
|
|
||||||
"@typescript-eslint/ban-ts-comment": "off",
|
|
||||||
"no-prototype-builtins": "off",
|
|
||||||
"@typescript-eslint/no-empty-function": "off"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,51 +1,35 @@
|
||||||
// @ts-check
|
|
||||||
import eslint from '@eslint/js';
|
|
||||||
import tseslint from 'typescript-eslint';
|
import tseslint from 'typescript-eslint';
|
||||||
|
import obsidianmd from "eslint-plugin-obsidianmd";
|
||||||
|
import globals from "globals";
|
||||||
|
import { globalIgnores } from "eslint/config";
|
||||||
|
|
||||||
export default tseslint.config(
|
export default tseslint.config(
|
||||||
eslint.configs.recommended,
|
|
||||||
tseslint.configs.recommendedTypeChecked,
|
|
||||||
{
|
{
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
},
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
projectService: true,
|
projectService: {
|
||||||
|
allowDefaultProject: [
|
||||||
|
'eslint.config.js',
|
||||||
|
'manifest.json'
|
||||||
|
]
|
||||||
|
},
|
||||||
tsconfigRootDir: import.meta.dirname,
|
tsconfigRootDir: import.meta.dirname,
|
||||||
|
extraFileExtensions: ['.json']
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
...obsidianmd.configs.recommended,
|
||||||
rules: {
|
globalIgnores([
|
||||||
"no-prototype-builtins": "off",
|
"node_modules",
|
||||||
'no-undef': 'off',
|
"dist",
|
||||||
"no-empty": "off",
|
"esbuild.config.mjs",
|
||||||
"@typescript-eslint/no-this-alias": "off",
|
"eslint.config.js",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"eslint.config.mjs",
|
||||||
"@typescript-eslint/no-unsafe-argument": "off",
|
"version-bump.mjs",
|
||||||
"@typescript-eslint/no-unsafe-assignment": "off",
|
"versions.json",
|
||||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
"main.js",
|
||||||
"@typescript-eslint/no-unsafe-return": "off",
|
]),
|
||||||
"@typescript-eslint/no-unsafe-call": "off",
|
);
|
||||||
"@typescript-eslint/no-namespace": "off",
|
|
||||||
'@typescript-eslint/no-require-imports': 'off',
|
|
||||||
"@typescript-eslint/restrict-plus-operands": "off",
|
|
||||||
"@typescript-eslint/require-await": "off",
|
|
||||||
"@typescript-eslint/no-empty-object-type": "off",
|
|
||||||
"@typescript-eslint/restrict-template-expressions": "off",
|
|
||||||
"@typescript-eslint/no-misused-promises": ["error", {
|
|
||||||
checksVoidReturn: false,
|
|
||||||
}],
|
|
||||||
"@typescript-eslint/no-floating-promises": ["error", {
|
|
||||||
checkThenables: true,
|
|
||||||
allowForKnownSafeCalls: [
|
|
||||||
{from: 'package', package: "expect", name: ["expect", "toEqual", "toMatch", "toMatchObject"]},
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
"@typescript-eslint/no-unused-vars": ["error", {
|
|
||||||
args: "none",
|
|
||||||
varsIgnorePattern: "^_",
|
|
||||||
destructuredArrayIgnorePattern: ".*",
|
|
||||||
ignoreRestSiblings: true,
|
|
||||||
}],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
);
|
|
||||||
1226
package-lock.json
generated
1226
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -8,7 +8,7 @@
|
||||||
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
|
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
|
||||||
"build-dev": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs development",
|
"build-dev": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs development",
|
||||||
"version": "node version-bump.mjs && git add manifest.json versions.json",
|
"version": "node version-bump.mjs && git add manifest.json versions.json",
|
||||||
"lint": "eslint src test",
|
"lint": "eslint src",
|
||||||
"test": "run-s test:*",
|
"test": "run-s test:*",
|
||||||
"test:unit": "tsc --noEmit && mocha",
|
"test:unit": "tsc --noEmit && mocha",
|
||||||
"test:e2e": "npx wdio run ./wdio.conf.mts",
|
"test:e2e": "npx wdio run ./wdio.conf.mts",
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
"chai": "^6.2.2",
|
"chai": "^6.2.2",
|
||||||
"esbuild": "^0.27.4",
|
"esbuild": "^0.27.4",
|
||||||
"eslint": "^9.39.4",
|
"eslint": "^9.39.4",
|
||||||
|
"eslint-plugin-obsidianmd": "^0.3.0",
|
||||||
"lodash.merge": "^4.6.2",
|
"lodash.merge": "^4.6.2",
|
||||||
"mocha": "^11.7.5",
|
"mocha": "^11.7.5",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue