mirror of
https://github.com/marktext/marktext.git
synced 2025-05-03 00:01:19 +08:00
Merge da25c189d0
into 11c8cc1e19
This commit is contained in:
commit
7dfc45045a
34
.eslintrc.js
34
.eslintrc.js
@ -2,7 +2,7 @@ module.exports = {
|
|||||||
root: true,
|
root: true,
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
parser: '@babel/eslint-parser',
|
parser: '@babel/eslint-parser',
|
||||||
ecmaVersion: 11,
|
ecmaVersion: 2022, // Update to ES2022
|
||||||
ecmaFeatures: {
|
ecmaFeatures: {
|
||||||
impliedStrict: true
|
impliedStrict: true
|
||||||
},
|
},
|
||||||
@ -10,45 +10,39 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
browser: true,
|
browser: true,
|
||||||
es6: true,
|
es2022: true, // Align with ES2022
|
||||||
node: true
|
node: true
|
||||||
},
|
},
|
||||||
extends: [
|
extends: [
|
||||||
'standard',
|
|
||||||
'eslint:recommended',
|
'eslint:recommended',
|
||||||
'plugin:vue/base',
|
'plugin:vue/vue3-recommended', // Updated for Vue 3
|
||||||
'plugin:import/errors',
|
'plugin:import/errors',
|
||||||
'plugin:import/warnings'
|
'plugin:import/warnings',
|
||||||
|
'standard'
|
||||||
],
|
],
|
||||||
globals: {
|
globals: {
|
||||||
__static: true
|
__static: true
|
||||||
},
|
},
|
||||||
plugins: ['html', 'vue'],
|
plugins: ['vue', 'import'],
|
||||||
rules: {
|
rules: {
|
||||||
// Two spaces but disallow semicolons
|
// Two spaces but disallow semicolons
|
||||||
indent: ['error', 2, { 'SwitchCase': 1, 'ignoreComments': true }],
|
indent: ['error', 2, { SwitchCase: 1, ignoreComments: true }],
|
||||||
semi: [2, 'never'],
|
semi: ['error', 'never'],
|
||||||
'no-return-await': 'error',
|
'no-return-await': 'error',
|
||||||
'no-return-assign': 'error',
|
'no-return-assign': 'error',
|
||||||
'no-new': 'error',
|
'no-new': 'error',
|
||||||
// allow paren-less arrow functions
|
'arrow-parens': ['error', 'always'], // Stricter enforcement for consistency
|
||||||
'arrow-parens': 'off',
|
'no-console': 'warn', // Warnings instead of allowing it outright
|
||||||
// allow console
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
|
||||||
'no-console': 'off',
|
'prefer-const': 'error', // Enforce best practices
|
||||||
// allow debugger during development
|
'no-mixed-operators': 'warn',
|
||||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
'no-prototype-builtins': 'warn'
|
||||||
'require-atomic-updates': 'off',
|
|
||||||
// TODO: fix these errors someday
|
|
||||||
'prefer-const': 'off',
|
|
||||||
'no-mixed-operators': 'off',
|
|
||||||
'no-prototype-builtins': 'off'
|
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
'import/resolver': {
|
'import/resolver': {
|
||||||
alias: {
|
alias: {
|
||||||
map: [
|
map: [
|
||||||
['common', './src/common'],
|
['common', './src/common'],
|
||||||
// Normally only valid for renderer/
|
|
||||||
['@', './src/renderer'],
|
['@', './src/renderer'],
|
||||||
['muya', './src/muya']
|
['muya', './src/muya']
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user