Compare commits

..

13 Commits

Author SHA1 Message Date
Anthony Fu
4e77637da4 chore: release v0.39.5 2023-06-04 16:20:46 +02:00
Anthony Fu
abf5c27385 fix: disable @typescript-eslint/consistent-type-assertions 2023-06-04 16:20:42 +02:00
曾明健
7b48da27dc chore(basic): refesh standard.js (#193) 2023-06-02 16:04:48 +02:00
曾明健
0947ddb151 feat(basic): ban deprecated syntax (#194) 2023-06-02 16:04:01 +02:00
L.Rain
0a9c9b0384 chore: simplified off rules (#192) 2023-06-01 16:08:06 +02:00
曾明健
84ae087ea0 chore(basic): add the missing restricted rules about window object (#191) 2023-05-31 14:40:11 +02:00
Anthony Fu
5d908028ca chore: release v0.39.4 2023-05-31 09:53:19 +02:00
Anthony Fu
610d886afd chore: remove window restriction 2023-05-31 09:52:26 +02:00
曾明健
aefa76e48a feat(basic): ban some deprecated global functions (#190) 2023-05-31 09:51:21 +02:00
曾明健
e787e9a647 feat(basic): ban global variable (#189) 2023-05-26 17:39:10 +02:00
曾明健
a3598d36d2 feat(ts): enable @typescript-eslint/consistent-type-assertions (#188) 2023-05-26 17:38:54 +02:00
Anthony Fu
7b399a63db chore: release v0.39.3 2023-05-23 13:39:23 +02:00
Anthony Fu
bb09e1d6b4 fix(vue): disable vue/no-dupe-keys 2023-05-23 13:39:17 +02:00
11 changed files with 41 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@antfu/eslint-config-monorepo", "name": "@antfu/eslint-config-monorepo",
"version": "0.39.2", "version": "0.39.5",
"private": true, "private": true,
"packageManager": "pnpm@8.5.1", "packageManager": "pnpm@8.5.1",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)", "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",

View File

@@ -240,7 +240,7 @@ module.exports = {
'no-debugger': 'error', 'no-debugger': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }], 'no-console': ['error', { allow: ['warn', 'error'] }],
'no-cond-assign': ['error', 'always'], 'no-cond-assign': ['error', 'always'],
'func-call-spacing': ['off', 'never'], 'func-call-spacing': 'off',
'key-spacing': ['error', { beforeColon: false, afterColon: true }], 'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'indent': ['error', 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }], 'indent': ['error', 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }],
'no-restricted-syntax': [ 'no-restricted-syntax': [
@@ -259,6 +259,32 @@ module.exports = {
asyncArrow: 'always', asyncArrow: 'always',
}, },
], ],
'no-restricted-globals': [
'error',
{ name: 'global', message: 'Use `globalThis` instead.' },
{ name: 'self', message: 'Use `globalThis` instead.' },
{ name: 'isNaN', message: 'Use `Number.isNaN` instead.' },
{ name: 'isFinite', message: 'Use `Number.isFinite` instead.' },
{ name: 'parseFloat', message: 'Use `Number.parseFloat` instead.' },
{ name: 'parseInt', message: 'Use `Number.parseInt` instead.' },
],
'no-restricted-properties': [
'error',
{ object: 'globalThis', property: 'isNaN', message: 'Use `Number.isNaN` instead.' },
{ object: 'globalThis', property: 'isFinite', message: 'Use `Number.isFinite` instead.' },
{ object: 'globalThis', property: 'parseFloat', message: 'Use `Number.parseFloat` instead.' },
{ object: 'globalThis', property: 'parseInt', message: 'Use `Number.parseInt` instead.' },
{ object: 'window', property: 'isNaN', message: 'Use `Number.isNaN` instead.' },
{ object: 'window', property: 'isFinite', message: 'Use `Number.isFinite` instead.' },
{ object: 'window', property: 'parseFloat', message: 'Use `Number.parseFloat` instead.' },
{ object: 'window', property: 'parseInt', message: 'Use `Number.parseInt` instead.' },
{ object: 'Math', property: 'pow', message: 'Use the exponentiation operator (**) instead.' },
{ property: '__proto__', message: 'Use `Object.getPrototypeOf` instead.' },
{ property: '__defineGetter__', message: 'Use `Object.defineProperty` instead.' },
{ property: '__defineSetter__', message: 'Use `Object.defineProperty` instead.' },
{ property: '__lookupGetter__', message: 'Use `Object.getOwnPropertyDescriptor` instead.' },
{ property: '__lookupSetter__', message: 'Use `Object.getOwnPropertyDescriptor` instead.' },
],
// es6 // es6
'no-var': 'error', 'no-var': 'error',
@@ -307,7 +333,7 @@ module.exports = {
'array-callback-return': 'error', 'array-callback-return': 'error',
'block-scoped-var': 'error', 'block-scoped-var': 'error',
'consistent-return': 'off', 'consistent-return': 'off',
'complexity': ['off', 11], 'complexity': 'off',
'eqeqeq': ['error', 'smart'], 'eqeqeq': ['error', 'smart'],
'no-alert': 'warn', 'no-alert': 'warn',
'no-case-declarations': 'error', 'no-case-declarations': 'error',

View File

@@ -1,6 +1,6 @@
{ {
"name": "@antfu/eslint-config-basic", "name": "@antfu/eslint-config-basic",
"version": "0.39.2", "version": "0.39.5",
"description": "", "description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)", "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT", "license": "MIT",

View File

@@ -9,20 +9,24 @@ module.exports = {
}, },
sourceType: 'module', sourceType: 'module',
}, },
env: { env: {
es2021: true, es2021: true,
node: true, node: true,
}, },
plugins: [ plugins: [
'import', 'import',
'n', 'n',
'promise', 'promise',
], ],
globals: { globals: {
document: 'readonly', document: 'readonly',
navigator: 'readonly', navigator: 'readonly',
window: 'readonly', window: 'readonly',
}, },
rules: { rules: {
'no-var': 'warn', 'no-var': 'warn',
'object-shorthand': ['warn', 'properties'], 'object-shorthand': ['warn', 'properties'],
@@ -126,7 +130,7 @@ module.exports = {
'no-mixed-operators': ['error', { 'no-mixed-operators': ['error', {
groups: [ groups: [
['==', '!=', '===', '!==', '>', '>=', '<', '<='], ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
['&&', '||', '?:'], ['&&', '||'],
['in', 'instanceof'], ['in', 'instanceof'],
], ],
allowSamePrecedence: true, allowSamePrecedence: true,

View File

@@ -1,6 +1,6 @@
{ {
"name": "@antfu/eslint-config-react", "name": "@antfu/eslint-config-react",
"version": "0.39.2", "version": "0.39.5",
"description": "", "description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)", "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT", "license": "MIT",

View File

@@ -72,7 +72,6 @@ module.exports = {
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'], '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/prefer-ts-expect-error': 'error', '@typescript-eslint/prefer-ts-expect-error': 'error',
'@typescript-eslint/no-require-imports': 'error', '@typescript-eslint/no-require-imports': 'error',
// Override JS // Override JS
'no-useless-constructor': 'off', 'no-useless-constructor': 'off',
'indent': 'off', 'indent': 'off',

View File

@@ -1,6 +1,6 @@
{ {
"name": "@antfu/eslint-config-ts", "name": "@antfu/eslint-config-ts",
"version": "0.39.2", "version": "0.39.5",
"description": "", "description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)", "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT", "license": "MIT",

View File

@@ -36,6 +36,7 @@ module.exports = {
'vue/multi-word-component-names': 'off', 'vue/multi-word-component-names': 'off',
'vue/prefer-import-from-vue': 'off', 'vue/prefer-import-from-vue': 'off',
'vue/no-v-text-v-html-on-component': 'off', 'vue/no-v-text-v-html-on-component': 'off',
'vue/no-dupe-keys': 'off',
// reactivity transform // reactivity transform
'vue/no-setup-props-destructure': 'off', 'vue/no-setup-props-destructure': 'off',

View File

@@ -1,6 +1,6 @@
{ {
"name": "@antfu/eslint-config-vue", "name": "@antfu/eslint-config-vue",
"version": "0.39.2", "version": "0.39.5",
"description": "", "description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)", "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT", "license": "MIT",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@antfu/eslint-config", "name": "@antfu/eslint-config",
"version": "0.39.2", "version": "0.39.5",
"description": "Anthony's ESLint config", "description": "Anthony's ESLint config",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)", "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT", "license": "MIT",

View File

@@ -1,6 +1,6 @@
{ {
"name": "eslint-plugin-antfu", "name": "eslint-plugin-antfu",
"version": "0.39.2", "version": "0.39.5",
"license": "MIT", "license": "MIT",
"homepage": "https://github.com/antfu/eslint-config", "homepage": "https://github.com/antfu/eslint-config",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",