Skip to content

Commit

Permalink
Update VSCode extensions and ESLint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
4dr1en committed Mar 21, 2024
1 parent 57aa76d commit b0798e6
Show file tree
Hide file tree
Showing 29 changed files with 1,015 additions and 278 deletions.
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"recommendations": [
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"editorconfig.editorconfig"
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint"
]
}
30 changes: 15 additions & 15 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
"eslint.workingDirectories": [
"packages/eslint-config",
"packages/synapse-bridge",
],

// Silent the stylistic rules in you IDE, but still auto fix them
// "eslint.rules.customizations": [
// { "rule": "style/*", "severity": "off" },
// { "rule": "*-indent", "severity": "off" },
// { "rule": "*-spacing", "severity": "off" },
// { "rule": "*-spaces", "severity": "off" },
// { "rule": "*-order", "severity": "off" },
// { "rule": "*-dangle", "severity": "off" },
// { "rule": "*-newline", "severity": "off" },
// { "rule": "*quotes", "severity": "off" },
// { "rule": "*semi", "severity": "off" }
// ],
// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @ts-check
import cnamts from '@cnamts/eslint-config'
import cnamts from '@cnamts/eslint-config';

export default cnamts()
export default cnamts();
9 changes: 5 additions & 4 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"node": ">=18.0.0"
},
"scripts": {
"lint": "eslint",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"build": "tsup"
},
"peerDependencies": {
Expand All @@ -49,7 +50,7 @@
"eslint-plugin-jsonc": "2.10.0",
"eslint-plugin-markdown": "3.0.1",
"eslint-plugin-n": "16.1.0",
"eslint-plugin-unicorn": "48.0.1",
"eslint-plugin-unicorn": "51.0.1",
"eslint-plugin-unused-imports": "3.0.0",
"eslint-plugin-vitest": "0.3.2",
"eslint-plugin-vue": "9.17.0",
Expand All @@ -62,8 +63,8 @@
},
"devDependencies": {
"@cnamts/eslint-config": "workspace:*",
"eslint": "8.52.0",
"tsup": "7.2.0"
"eslint": "8.57.0",
"tsup": "8.0.2"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-config/src/configs/casePolice.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type FlatESLintConfigItem } from 'eslint-define-config'
import { ESLint } from 'eslint'
import { pluginCasePolice } from '../plugins'
import { type FlatESLintConfigItem } from 'eslint-define-config';
import { ESLint } from 'eslint';
import { pluginCasePolice } from '../plugins';

export const casePolice: FlatESLintConfigItem[] = [
{
Expand All @@ -11,4 +11,4 @@ export const casePolice: FlatESLintConfigItem[] = [
'case/string-check': 'error',
},
},
]
];
6 changes: 3 additions & 3 deletions packages/eslint-config/src/configs/ignores.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type FlatESLintConfigItem } from 'eslint-define-config'
import { GLOB_EXCLUDE } from '../globs'
import { type FlatESLintConfigItem } from 'eslint-define-config';
import { GLOB_EXCLUDE } from '../globs';

export const ignores: FlatESLintConfigItem[] = [
{
ignores: GLOB_EXCLUDE,
},
]
];
6 changes: 3 additions & 3 deletions packages/eslint-config/src/configs/imports.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type FlatESLintConfigItem } from 'eslint-define-config'
import { pluginAntfu, pluginImport } from '../plugins'
import { type FlatESLintConfigItem } from 'eslint-define-config';
import { pluginAntfu, pluginImport } from '../plugins';

export const imports: FlatESLintConfigItem[] = [
{
Expand Down Expand Up @@ -68,4 +68,4 @@ export const imports: FlatESLintConfigItem[] = [
'import/order': 'error',
},
},
]
];
30 changes: 15 additions & 15 deletions packages/eslint-config/src/configs/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export * from './casePolice'
export * from './ignores'
export * from './imports'
export * from './javascript'
export * from './jsdoc'
export * from './jsonc'
export * from './markdown'
export * from './node'
export * from './sort'
export * from './stylistic'
export * from './tests'
export * from './typescript'
export * from './unicorn'
export * from './vue'
export * from './yaml'
export * from './casePolice';
export * from './ignores';
export * from './imports';
export * from './javascript';
export * from './jsdoc';
export * from './jsonc';
export * from './markdown';
export * from './node';
export * from './sort';
export * from './stylistic';
export * from './tests';
export * from './typescript';
export * from './unicorn';
export * from './vue';
export * from './yaml';
10 changes: 5 additions & 5 deletions packages/eslint-config/src/configs/javascript.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type FlatESLintConfigItem } from 'eslint-define-config'
import globals from 'globals'
import { pluginAntfu, pluginUnusedImports } from '../plugins'
import { GLOB_SRC, GLOB_SRC_EXT } from '../globs'
import { type FlatESLintConfigItem } from 'eslint-define-config';
import globals from 'globals';
import { pluginAntfu, pluginUnusedImports } from '../plugins';
import { GLOB_SRC, GLOB_SRC_EXT } from '../globs';

export const javascript: FlatESLintConfigItem[] = [
{
Expand Down Expand Up @@ -38,4 +38,4 @@ export const javascript: FlatESLintConfigItem[] = [
'no-console': 'off',
},
},
]
];
6 changes: 3 additions & 3 deletions packages/eslint-config/src/configs/jsdoc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type FlatESLintConfigItem } from 'eslint-define-config'
import { pluginJsdoc } from '../plugins'
import { type FlatESLintConfigItem } from 'eslint-define-config';
import { pluginJsdoc } from '../plugins';

export const jsdoc: FlatESLintConfigItem[] = [
{
Expand Down Expand Up @@ -33,4 +33,4 @@ export const jsdoc: FlatESLintConfigItem[] = [
'jsdoc/tag-lines': 'error',
},
},
]
];
10 changes: 5 additions & 5 deletions packages/eslint-config/src/configs/jsonc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type FlatESLintConfigItem } from 'eslint-define-config'
import { ESLint } from 'eslint'
import { GLOB_JSON, GLOB_JSON5, GLOB_JSONC } from '../globs'
import { parserJsonc, pluginJsonc } from '../plugins'
import { type FlatESLintConfigItem } from 'eslint-define-config';
import { ESLint } from 'eslint';
import { GLOB_JSON, GLOB_JSON5, GLOB_JSONC } from '../globs';
import { parserJsonc, pluginJsonc } from '../plugins';

export const jsonc: FlatESLintConfigItem[] = [
{
Expand Down Expand Up @@ -66,4 +66,4 @@ export const jsonc: FlatESLintConfigItem[] = [
'jsonc/space-unary-ops': 'error',
},
},
]
];
8 changes: 4 additions & 4 deletions packages/eslint-config/src/configs/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type FlatESLintConfigItem } from 'eslint-define-config'
import { GLOB_MARKDOWN, GLOB_SRC, GLOB_VUE } from '../globs'
import { pluginMarkdown } from '../plugins'
import { type FlatESLintConfigItem } from 'eslint-define-config';
import { GLOB_MARKDOWN, GLOB_SRC, GLOB_VUE } from '../globs';
import { pluginMarkdown } from '../plugins';

export const markdown: FlatESLintConfigItem[] = [
{
Expand Down Expand Up @@ -67,4 +67,4 @@ export const markdown: FlatESLintConfigItem[] = [
'ts/unbound-method': 'off',
},
},
]
];
6 changes: 3 additions & 3 deletions packages/eslint-config/src/configs/node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type FlatESLintConfigItem } from 'eslint-define-config'
import { pluginNode } from '../plugins'
import { type FlatESLintConfigItem } from 'eslint-define-config';
import { pluginNode } from '../plugins';

export const node: FlatESLintConfigItem[] = [
{
Expand Down Expand Up @@ -31,4 +31,4 @@ export const node: FlatESLintConfigItem[] = [
'node/shebang': 'error',
},
},
]
];
6 changes: 3 additions & 3 deletions packages/eslint-config/src/configs/sort.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FlatESLintConfigItem } from 'eslint-define-config'
import { type FlatESLintConfigItem } from 'eslint-define-config';

/**
* Sort package.json
Expand Down Expand Up @@ -90,7 +90,7 @@ export const sortPackageJson: FlatESLintConfigItem[] = [
],
},
},
]
];

/**
* Sort tsconfig.json
Expand Down Expand Up @@ -225,4 +225,4 @@ export const sortTsconfig: FlatESLintConfigItem[] = [
],
},
},
]
];
8 changes: 4 additions & 4 deletions packages/eslint-config/src/configs/stylistic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type FlatESLintConfigItem } from 'eslint-define-config'
import { pluginAntfu, pluginStylistic } from '../plugins'
import { type FlatESLintConfigItem } from 'eslint-define-config';
import { pluginAntfu, pluginStylistic } from '../plugins';

export const stylistic: FlatESLintConfigItem[] = [
{
Expand Down Expand Up @@ -265,7 +265,7 @@ export const stylistic: FlatESLintConfigItem[] = [
},
],
'style/rest-spread-spacing': ['error', 'never'],
'style/semi': ['error', 'never'],
'style/semi': ['error', 'always'],
'style/semi-spacing': [
'error',
{
Expand Down Expand Up @@ -332,4 +332,4 @@ export const stylistic: FlatESLintConfigItem[] = [
'style/yield-star-spacing': ['error', 'both'],
},
},
]
];
10 changes: 5 additions & 5 deletions packages/eslint-config/src/configs/tests.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type FlatESLintConfigItem } from 'eslint-define-config'
import { pluginVitest } from '../plugins'
import { GLOB_TESTS } from '../globs'
import { isInEditor } from '../env'
import { type FlatESLintConfigItem } from 'eslint-define-config';
import { pluginVitest } from '../plugins';
import { GLOB_TESTS } from '../globs';
import { isInEditor } from '../env';

export const tests: FlatESLintConfigItem[] = [
{
Expand Down Expand Up @@ -51,4 +51,4 @@ export const tests: FlatESLintConfigItem[] = [
'tests/valid-title': 'error',
},
},
]
];
12 changes: 6 additions & 6 deletions packages/eslint-config/src/configs/typescript.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ESLint } from 'eslint'
import { type FlatESLintConfigItem } from 'eslint-define-config'
import { parserTs, pluginTs } from '../plugins'
import { GLOB_TS } from '../globs'
import { renameRules } from '../utils'
import { ESLint } from 'eslint';
import { type FlatESLintConfigItem } from 'eslint-define-config';
import { parserTs, pluginTs } from '../plugins';
import { GLOB_TS } from '../globs';
import { renameRules } from '../utils';

export const typescript: FlatESLintConfigItem[] = [
{
Expand Down Expand Up @@ -34,4 +34,4 @@ export const typescript: FlatESLintConfigItem[] = [
'ts/no-non-null-assertion': 'off',
},
},
]
];
Loading

0 comments on commit b0798e6

Please sign in to comment.