A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/antfu/eslint-config/commit/917dd48 below:

set plugin alias of `yml/` to `yaml/` · antfu/eslint-config@917dd48 · GitHub

File tree Expand file treeCollapse file tree 6 files changed

+63

-62

lines changed

Filter options

Expand file treeCollapse file tree 6 files changed

+63

-62

lines changed Original file line number Diff line number Diff line change

@@ -199,12 +199,13 @@ Check out the [configs](https://github.com/antfu/eslint-config/blob/main/src/con

199 199 200 200

Since flat config requires us to explicitly provide the plugin names (instead of mandatory convention from npm package name), we renamed some plugins to make overall scope more consistent and easier to write.

201 201 202 -

| Original Prefix | New Prefix | Source Plugin |

203 -

| --------------- | ---------- | ------------- |

204 -

| `i/*` | `import/*` | [eslint-plugin-i](https://github.com/un-es/eslint-plugin-i) |

205 -

| `n/*` | `node/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n)

206 -

| `@typescript-eslint/*` | `ts/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |

207 -

| `@stylistic/*` | `style/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |

202 +

| New Prefix | Original Prefix | Source Plugin |

203 +

| --- | --- | --- |

204 +

| `import/*` | `i/*` | [eslint-plugin-i](https://github.com/un-es/eslint-plugin-i) |

205 +

| `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) |

206 +

| `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |

207 +

| `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |

208 +

| `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |

208 209 209 210

When you want to overrides rules, or disable them inline, you need to update to the new prefix:

210 211 Original file line number Diff line number Diff line change

@@ -11,5 +11,5 @@ export * from './stylistic'

11 11

export * from './typescript'

12 12

export * from './unicorn'

13 13

export * from './vue'

14 -

export * from './yml'

14 +

export * from './yaml'

15 15

export * from './test'

Original file line number Diff line number Diff line change

@@ -0,0 +1,51 @@

1 +

import type { FlatESLintConfigItem } from 'eslint-define-config'

2 +

import { GLOB_YAML } from '../globs'

3 +

import { parserYaml, pluginYaml } from '../plugins'

4 +

import { OFF } from '../flags'

5 +

import type { OptionsOverrides } from '../types'

6 + 7 +

export function yaml(options: OptionsOverrides = {}): FlatESLintConfigItem[] {

8 +

const {

9 +

overrides = {},

10 +

} = options

11 + 12 +

return [

13 +

{

14 +

plugins: {

15 +

yaml: pluginYaml as any,

16 +

},

17 +

},

18 +

{

19 +

files: [GLOB_YAML],

20 +

languageOptions: {

21 +

parser: parserYaml,

22 +

},

23 +

rules: {

24 +

'style/spaced-comment': OFF,

25 + 26 +

'yaml/block-mapping': 'error',

27 +

'yaml/block-mapping-question-indicator-newline': 'error',

28 +

'yaml/block-sequence': 'error',

29 +

'yaml/block-sequence-hyphen-indicator-newline': 'error',

30 +

'yaml/flow-mapping-curly-newline': 'error',

31 +

'yaml/flow-mapping-curly-spacing': 'error',

32 +

'yaml/flow-sequence-bracket-newline': 'error',

33 +

'yaml/flow-sequence-bracket-spacing': 'error',

34 +

'yaml/indent': ['error', 2],

35 +

'yaml/key-spacing': 'error',

36 +

'yaml/no-empty-key': 'error',

37 +

'yaml/no-empty-sequence-entry': 'error',

38 +

'yaml/no-irregular-whitespace': 'error',

39 +

'yaml/no-tab-indent': 'error',

40 +

'yaml/plain-scalar': 'error',

41 + 42 +

'yaml/quotes': ['error', { avoidEscape: false, prefer: 'single' }],

43 +

'yaml/spaced-comment': 'error',

44 + 45 +

'yaml/vue-custom-block/no-parsing-error': 'error',

46 + 47 +

...overrides,

48 +

},

49 +

},

50 +

]

51 +

}

Original file line number Diff line number Diff line change

@@ -20,7 +20,7 @@ import {

20 20

typescriptWithTypes,

21 21

unicorn,

22 22

vue,

23 -

yml,

23 +

yaml,

24 24

} from './configs'

25 25

import type { OptionsConfig } from './types'

26 26

import { combine } from './utils'

@@ -129,7 +129,7 @@ export function antfu(options: OptionsConfig & FlatESLintConfigItem = {}, ...use

129 129

}

130 130 131 131

if (options.yaml ?? true) {

132 -

configs.push(yml({

132 +

configs.push(yaml({

133 133

overrides: overrides.yaml,

134 134

}))

135 135

}

Original file line number Diff line number Diff line change

@@ -13,10 +13,10 @@ export { default as pluginTs } from '@typescript-eslint/eslint-plugin'

13 13

export { default as pluginUnicorn } from 'eslint-plugin-unicorn'

14 14

export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports'

15 15

export { default as pluginVue } from 'eslint-plugin-vue'

16 -

export { default as pluginYml } from 'eslint-plugin-yml'

16 +

export { default as pluginYaml } from 'eslint-plugin-yml'

17 17

export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests'

18 18 19 19

export { default as parserTs } from '@typescript-eslint/parser'

20 20

export { default as parserVue } from 'vue-eslint-parser'

21 -

export { default as parserYml } from 'yaml-eslint-parser'

21 +

export { default as parserYaml } from 'yaml-eslint-parser'

22 22

export { default as parserJsonc } from 'jsonc-eslint-parser'

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4