mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
Update eslint config to new flat config format
https://eslint.org/docs/latest/use/configure/migration-guide
This commit is contained in:
parent
7b7a0b9e46
commit
54db192be8
5 changed files with 2740 additions and 650 deletions
|
|
@ -1,17 +0,0 @@
|
|||
build/*
|
||||
chrome/content/zotero/xpcom/citeproc.js
|
||||
chrome/content/zotero/xpcom/isbn.js
|
||||
chrome/content/zotero/xpcom/rdf/*
|
||||
chrome/content/zotero/xpcom/xregexp/*
|
||||
chrome/content/zotero/xpcom/translation/tlds.js
|
||||
chrome/skin/default/zotero/timeline/bundle.js
|
||||
chrome/skin/default/zotero/timeline/timeline-api.js
|
||||
resource/bluebird/*
|
||||
resource/classnames.js
|
||||
resource/csl-validator.js
|
||||
resource/jspath.js
|
||||
resource/prop-types.js
|
||||
resource/react*
|
||||
resource/tinymce/*
|
||||
test/resource/*
|
||||
translators/*
|
||||
63
.eslintrc
63
.eslintrc
|
|
@ -1,63 +0,0 @@
|
|||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"globals": {
|
||||
"Zotero": false,
|
||||
"ZOTERO_CONFIG": false,
|
||||
"AddonManager": false,
|
||||
"Cc": false,
|
||||
"Ci": false,
|
||||
"ChromeUtils": false,
|
||||
"Components": false,
|
||||
"ConcurrentCaller": false,
|
||||
"ctypes": false,
|
||||
"OS": false,
|
||||
"MozXULElement": false,
|
||||
"PluralForm": false,
|
||||
"Services": false,
|
||||
"windowUtils": false,
|
||||
"XPCOMUtils": false,
|
||||
"XRegExp": false,
|
||||
"XULElement": false,
|
||||
"XULElementBase": false,
|
||||
"ItemPaneSectionElementBase": false,
|
||||
"Cu": false,
|
||||
"ChromeWorker": false,
|
||||
"Localization": false,
|
||||
"L10nFileSource": false,
|
||||
"L10nRegistry": false,
|
||||
"ZoteroPane_Local": false,
|
||||
"ZoteroPane": false,
|
||||
"Zotero_Tabs": false,
|
||||
"ZoteroContextPane": false,
|
||||
"IOUtils": false,
|
||||
"NetUtil": false,
|
||||
"FileUtils": false,
|
||||
"globalThis": false
|
||||
},
|
||||
"extends": [
|
||||
"@zotero",
|
||||
"plugin:react/recommended"
|
||||
],
|
||||
"parser": "@babel/eslint-parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"react",
|
||||
"@babel"
|
||||
],
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "17.0"
|
||||
}
|
||||
},
|
||||
"rules": {}
|
||||
}
|
||||
115
eslint.config.mjs
Normal file
115
eslint.config.mjs
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
import reactPlugin from "eslint-plugin-react";
|
||||
import babel from "@babel/eslint-plugin";
|
||||
import globals from "globals";
|
||||
import babelParser from "@babel/eslint-parser";
|
||||
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 [
|
||||
...compat.extends("@zotero"),
|
||||
|
||||
{
|
||||
files: ['**/*.{js,jsm,jsx,mjs}'],
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
Zotero: "readonly",
|
||||
ZOTERO_CONFIG: "readonly",
|
||||
AddonManager: "readonly",
|
||||
Cc: "readonly",
|
||||
Ci: "readonly",
|
||||
ChromeUtils: "readonly",
|
||||
Components: "readonly",
|
||||
ConcurrentCaller: "readonly",
|
||||
ctypes: "readonly",
|
||||
OS: "readonly",
|
||||
MozXULElement: "readonly",
|
||||
PathUtils: "readonly",
|
||||
PluralForm: "readonly",
|
||||
Services: "readonly",
|
||||
windowUtils: "readonly",
|
||||
XPCOMUtils: "readonly",
|
||||
XRegExp: "readonly",
|
||||
XULElement: "readonly",
|
||||
XULElementBase: "readonly",
|
||||
ItemPaneSectionElementBase: "readonly",
|
||||
Cu: "readonly",
|
||||
ChromeWorker: "readonly",
|
||||
Localization: "readonly",
|
||||
L10nFileSource: "readonly",
|
||||
L10nRegistry: "readonly",
|
||||
ZoteroPane_Local: "readonly",
|
||||
ZoteroPane: "readonly",
|
||||
Zotero_Tabs: "readonly",
|
||||
ZoteroContextPane: "readonly",
|
||||
IOUtils: "readonly",
|
||||
NetUtil: "readonly",
|
||||
FileUtils: "readonly",
|
||||
globalThis: "readonly",
|
||||
},
|
||||
|
||||
parser: babelParser,
|
||||
ecmaVersion: 2018,
|
||||
sourceType: "module",
|
||||
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
plugins: {
|
||||
"@babel": babel,
|
||||
},
|
||||
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
reactPlugin.configs.flat.recommended,
|
||||
reactPlugin.configs.flat['jsx-runtime'],
|
||||
|
||||
{
|
||||
ignores: [
|
||||
"build/*",
|
||||
"chrome/content/zotero/xpcom/citeproc.js",
|
||||
"chrome/content/zotero/xpcom/isbn.js",
|
||||
"chrome/content/zotero/xpcom/rdf/*",
|
||||
"chrome/content/zotero/xpcom/xregexp/*",
|
||||
"chrome/content/zotero/xpcom/translation/tlds.js",
|
||||
"chrome/skin/default/zotero/timeline/bundle.js",
|
||||
"chrome/skin/default/zotero/timeline/timeline-api.js",
|
||||
"resource/bluebird/*",
|
||||
"resource/classnames.js",
|
||||
"resource/citeproc_rs*",
|
||||
"resource/csl-validator.js",
|
||||
"resource/jspath.js",
|
||||
"resource/loader.jsm",
|
||||
"resource/pako.js",
|
||||
"resource/PluralForm.jsm",
|
||||
"resource/prop-types.js",
|
||||
"resource/react*",
|
||||
"resource/require.js",
|
||||
"resource/SingleFile/*",
|
||||
"resource/tinymce/*",
|
||||
"test/resource/*",
|
||||
"translators/*",
|
||||
]
|
||||
}
|
||||
];
|
||||
3188
package-lock.json
generated
3188
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -36,6 +36,8 @@
|
|||
"@babel/eslint-parser": "^7.16.5",
|
||||
"@babel/eslint-plugin": "^7.16.5",
|
||||
"@babel/preset-react": "^7.16.5",
|
||||
"@eslint/eslintrc": "^3.2.0",
|
||||
"@eslint/js": "^9.17.0",
|
||||
"@zotero/eslint-config": "^1.0.8",
|
||||
"acorn": "^8.8.2",
|
||||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
|
||||
|
|
@ -46,10 +48,11 @@
|
|||
"co-mocha": "^1.2.1",
|
||||
"colors": "^1.4.0",
|
||||
"eslint": "^8.5.0",
|
||||
"eslint-plugin-react": "^7.28.0",
|
||||
"eslint-plugin-react-hooks": "^4.0.4",
|
||||
"eslint-plugin-react": "^7.37.3",
|
||||
"eslint-plugin-react-hooks": "^5.1.0",
|
||||
"fs-extra": "^3.0.1",
|
||||
"ftl-tx": "^0.16.0",
|
||||
"globals": "^15.14.0",
|
||||
"globby": "^6.1.0",
|
||||
"jspath": "^0.4.0",
|
||||
"mocha": "^10.4.0",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue