Compare commits

..

6 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
10 changed files with 32 additions and 20 deletions

View File

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

View File

@@ -240,7 +240,7 @@ module.exports = {
'no-debugger': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-cond-assign': ['error', 'always'],
'func-call-spacing': ['off', 'never'],
'func-call-spacing': 'off',
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'indent': ['error', 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }],
'no-restricted-syntax': [
@@ -263,17 +263,27 @@ module.exports = {
'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' },
{ 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: '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
@@ -323,7 +333,7 @@ module.exports = {
'array-callback-return': 'error',
'block-scoped-var': 'error',
'consistent-return': 'off',
'complexity': ['off', 11],
'complexity': 'off',
'eqeqeq': ['error', 'smart'],
'no-alert': 'warn',
'no-case-declarations': 'error',

View File

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

View File

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

View File

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

View File

@@ -72,8 +72,6 @@ module.exports = {
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/prefer-ts-expect-error': 'error',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' }],
// Override JS
'no-useless-constructor': 'off',
'indent': 'off',

View File

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

View File

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

View File

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

View File

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