mirror of
https://github.com/land0r/obsidian-flowchart-plugin.git
synced 2026-07-22 05:32:04 +00:00
feat: Update - Simplify eslint configuration to streamline TypeScript support and linting rules
This commit is contained in:
parent
21d3706f98
commit
5e6a5bdf5b
3 changed files with 25 additions and 26 deletions
|
|
@ -1,3 +0,0 @@
|
|||
node_modules/
|
||||
|
||||
main.js
|
||||
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"
|
||||
}
|
||||
}
|
||||
25
eslint.config.js
Normal file
25
eslint.config.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
const typescriptEslintParser = require("@typescript-eslint/parser");
|
||||
const typescriptEslintPlugin = require("@typescript-eslint/eslint-plugin");
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
ignores: ["node_modules", "main.js"], // Ignoring the default generated files and directories
|
||||
},
|
||||
{
|
||||
files: ["**/*.ts"], // Apply the configuration to TypeScript files
|
||||
languageOptions: {
|
||||
parser: typescriptEslintParser,
|
||||
ecmaVersion: "latest", // Always using the latest ECMAScript version
|
||||
sourceType: "module", // Modern JavaScript uses module import/export syntax
|
||||
},
|
||||
plugins: {
|
||||
"@typescript-eslint": typescriptEslintPlugin, // Using TypeScript-specific plugin
|
||||
},
|
||||
rules: {
|
||||
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], // Replacing 'no-unused-vars' with TS-specific version
|
||||
"@typescript-eslint/ban-ts-comment": "off", // Allowing use of ts comments if needed
|
||||
"@typescript-eslint/no-empty-function": "off", // Allowing empty functions for flexibility
|
||||
"no-prototype-builtins": "off", // Allowing direct calls to object's prototype functions
|
||||
},
|
||||
},
|
||||
];
|
||||
Loading…
Reference in a new issue