@ntnyq/eslint-config 2.0.0-beta.2 → 2.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,27 +1,49 @@
1
1
  {
2
2
  "name": "@ntnyq/eslint-config",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.2",
5
- "packageManager": "pnpm@7.29.1",
6
- "description": "",
7
- "keywords": [],
4
+ "version": "2.0.0-beta.20",
5
+ "description": "ESLint flat config of ntnyq",
6
+ "keywords": [
7
+ "eslint",
8
+ "eslint-config",
9
+ "eslint-flat-config",
10
+ "ntnyq"
11
+ ],
8
12
  "license": "MIT",
9
13
  "author": {
10
14
  "name": "ntnyq",
11
15
  "email": "ntnyq13@gmail.com"
12
16
  },
13
- "main": "./index.js",
14
- "module": "./index.js",
15
- "types": "./index.d.ts",
17
+ "repository": "ntnyq/eslint-config",
16
18
  "exports": {
17
- "types": "./index.d.ts",
18
- "require": "./index.js",
19
- "import": "./index.js"
19
+ "./package.json": "./package.json",
20
+ ".": {
21
+ "import": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/index.js"
24
+ },
25
+ "require": {
26
+ "types": "./dist/index.d.cts",
27
+ "default": "./dist/index.cjs"
28
+ }
29
+ }
20
30
  },
31
+ "main": "./dist/index.js",
32
+ "module": "./dist/index.js",
33
+ "types": "./dist/index.d.ts",
21
34
  "files": [
22
- "index.js",
23
- "lib"
35
+ "dist"
24
36
  ],
37
+ "scripts": {
38
+ "build": "tsup",
39
+ "clean": "rimraf dist",
40
+ "lint": "ESLINT_USE_FLAT_CONFIG=true eslint -c eslint.config.mjs .",
41
+ "prepare": "husky install",
42
+ "release": "run-s release:check release:version",
43
+ "release:check": "run-s clean build lint typecheck",
44
+ "release:version": "bumpp && npm publish --tag next",
45
+ "typecheck": "tsc --noEmit"
46
+ },
25
47
  "publishConfig": {
26
48
  "access": "public"
27
49
  },
@@ -29,42 +51,49 @@
29
51
  "eslint": "^8.30.0"
30
52
  },
31
53
  "dependencies": {
32
- "@eslint/js": "^8.35.0",
33
- "@typescript-eslint/eslint-plugin": "^5.54.1",
34
- "@typescript-eslint/parser": "^5.54.1",
35
- "astro-eslint-parser": "^0.12.0",
36
- "eslint-config-prettier": "^8.7.0",
37
- "eslint-plugin-astro": "^0.24.0",
54
+ "@eslint/js": "^8.49.0",
55
+ "@typescript-eslint/eslint-plugin": "^6.7.2",
56
+ "@typescript-eslint/parser": "^6.7.2",
57
+ "@unocss/eslint-plugin": "^0.56.0",
58
+ "astro-eslint-parser": "^0.15.0",
59
+ "eslint-config-prettier": "^9.0.0",
60
+ "eslint-define-config": "^1.23.0",
61
+ "eslint-plugin-astro": "^0.29.0",
38
62
  "eslint-plugin-eslint-comments": "^3.2.0",
39
- "eslint-plugin-import": "^2.27.5",
40
- "eslint-plugin-jsonc": "^2.6.0",
41
- "eslint-plugin-markdown": "^3.0.0",
42
- "eslint-plugin-prettier": "^4.2.1",
43
- "eslint-plugin-unicorn": "^46.0.0",
44
- "eslint-plugin-vue": "^9.9.0",
45
- "eslint-plugin-yml": "^1.5.0",
46
- "globals": "^13.20.0",
47
- "jsonc-eslint-parser": "^2.2.0",
48
- "prettier": "^2.8.4",
49
- "vue-eslint-parser": "^9.1.0",
50
- "yaml-eslint-parser": "^1.2.0"
63
+ "eslint-plugin-i": "^2.28.1",
64
+ "eslint-plugin-jsonc": "^2.9.0",
65
+ "eslint-plugin-markdown": "^3.0.1",
66
+ "eslint-plugin-n": "^16.1.0",
67
+ "eslint-plugin-prettier": "^5.0.0",
68
+ "eslint-plugin-react": "^7.33.2",
69
+ "eslint-plugin-react-hooks": "^4.6.0",
70
+ "eslint-plugin-unicorn": "^48.0.1",
71
+ "eslint-plugin-vue": "^9.17.0",
72
+ "eslint-plugin-yml": "^1.9.0",
73
+ "globals": "^13.21.0",
74
+ "jsonc-eslint-parser": "^2.3.0",
75
+ "local-pkg": "^0.4.3",
76
+ "prettier": "^3.0.3",
77
+ "vue-eslint-parser": "^9.3.1",
78
+ "yaml-eslint-parser": "^1.2.2"
51
79
  },
52
80
  "devDependencies": {
53
- "@ntnyq/prettier-config": "^1.4.1",
54
- "@types/node": "^18.15.0",
55
- "bumpp": "^9.0.0",
56
- "eslint": "^8.35.0",
57
- "eslint-define-config": "^1.16.0",
81
+ "@ntnyq/prettier-config": "^1.14.0",
82
+ "@types/node": "^20.6.3",
83
+ "bumpp": "^9.2.0",
84
+ "eslint": "^8.49.0",
58
85
  "husky": "^8.0.3",
59
86
  "nano-staged": "^0.8.0",
60
- "typescript": "5.0.0-beta"
87
+ "npm-run-all": "^4.1.5",
88
+ "rimraf": "^5.0.1",
89
+ "tsup": "^7.2.0",
90
+ "typescript": "5.2.2"
61
91
  },
62
92
  "engines": {
63
- "node": ">=14.19.0"
93
+ "node": ">=18.12"
64
94
  },
65
95
  "prettier": "@ntnyq/prettier-config",
66
- "scripts": {
67
- "lint": "eslint .",
68
- "release": "bumpp && pnpm publish --tag next"
96
+ "nano-staged": {
97
+ "*.{js,ts,json,jsonc,md,yaml,yml}": "bun run lint --fix"
69
98
  }
70
- }
99
+ }
package/index.js DELETED
@@ -1,9 +0,0 @@
1
- export * from './lib/js.js'
2
- export * from './lib/ts.js'
3
- export * from './lib/yml.js'
4
- export * from './lib/vue.js'
5
- export * from './lib/astro.js'
6
- export * from './lib/jsonc.js'
7
- export * from './lib/prettier.js'
8
- export * from './lib/markdown.js'
9
- export * from './lib/eslint-comments.js'
package/lib/astro.js DELETED
@@ -1,24 +0,0 @@
1
- import astroPlugin, { configs } from 'eslint-plugin-astro'
2
- import astroParser from 'astro-eslint-parser'
3
- import { GLOB_EXCLUDE, GLOB_ASTRO } from './shared.js'
4
-
5
- /** @type {import('eslint-define-config').FlatESLintConfig[]} */
6
- export const astro = [
7
- {
8
- files: [GLOB_ASTRO],
9
- ignores: GLOB_EXCLUDE,
10
- plugins: {
11
- astro: astroPlugin,
12
- },
13
- languageOptions: {
14
- parser: astroParser,
15
- parserOptions: {
16
- parser: '@typescript-eslint/parser',
17
- extraFileExtensions: ['.astro'],
18
- },
19
- },
20
- rules: {
21
- ...configs.recommended,
22
- },
23
- },
24
- ]
@@ -1,14 +0,0 @@
1
- import commentsPlugin from 'eslint-plugin-eslint-comments'
2
-
3
- /** @type {import('eslint-define-config').FlatESLintConfig[]} */
4
- export const eslintComments = [
5
- {
6
- plugins: {
7
- 'eslint-comments': commentsPlugin,
8
- },
9
- rules: {
10
- ...commentsPlugin.configs.recommended.rules,
11
- 'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
12
- },
13
- },
14
- ]
package/lib/js.js DELETED
@@ -1,156 +0,0 @@
1
- import globals from 'globals'
2
- import jsConfig from '@eslint/js'
3
- import importPlugin from 'eslint-plugin-import'
4
- import unicornPlugin from 'eslint-plugin-unicorn'
5
- import { GLOB_EXCLUDE } from './shared.js'
6
-
7
- /** @type {import('eslint-define-config').FlatESLintConfig[]} */
8
- export const js = [
9
- jsConfig.configs.recommended,
10
- {
11
- languageOptions: {
12
- globals: {
13
- ...globals.browser,
14
- ...globals.es2021,
15
- ...globals.node,
16
- },
17
- sourceType: 'module',
18
- },
19
- rules: {},
20
- },
21
-
22
- {
23
- files: ['**/scripts/*', '**/cli.*'],
24
- ignores: GLOB_EXCLUDE,
25
- rules: {
26
- 'no-console': 'off',
27
- },
28
- },
29
-
30
- {
31
- files: ['**/*.{test,spec}.js?(x)'],
32
- rules: {
33
- 'no-unused-expressions': 'off',
34
- 'max-lines-per-function': 'off',
35
- },
36
- },
37
- ]
38
-
39
- /** @type {import('eslint-define-config').FlatESLintConfig[]} */
40
- export const jsx = [
41
- {
42
- files: ['**/*.jsx'],
43
- ignores: GLOB_EXCLUDE,
44
- languageOptions: {
45
- parserOptions: {
46
- ecmaFeatures: {
47
- jsx: true,
48
- },
49
- },
50
- },
51
- },
52
- ]
53
-
54
- /** @type {import('eslint-define-config').FlatESLintConfig[]} */
55
- export const imports = [
56
- {
57
- plugins: {
58
- import: importPlugin,
59
- },
60
- settings: {
61
- 'import/resolver': {
62
- node: { extensions: ['.js', '.mjs', '.ts', '.d.ts'] },
63
- },
64
- },
65
- rules: {
66
- 'import/first': 'error',
67
- 'import/no-mutable-exports': 'error',
68
- 'import/no-duplicates': 'error',
69
- 'import/order': [
70
- 'error',
71
- {
72
- groups: [
73
- 'builtin',
74
- 'external',
75
- 'internal',
76
- 'parent',
77
- 'sibling',
78
- 'index',
79
- 'object',
80
- 'type',
81
- ],
82
- pathGroups: [{ pattern: '@/**', group: 'internal' }],
83
- pathGroupsExcludedImportTypes: ['type'],
84
- },
85
- ],
86
- },
87
- },
88
- ]
89
-
90
- /** @type {import('eslint-define-config').FlatESLintConfig[]} */
91
- export const unicorn = [
92
- {
93
- plugins: {
94
- unicorn: unicornPlugin,
95
- },
96
- rules: {
97
- 'unicorn/no-unsafe-regex': 'off',
98
-
99
- 'unicorn/error-message': 'error',
100
- 'unicorn/escape-case': 'error',
101
- 'unicorn/no-new-buffer': 'error',
102
- 'unicorn/number-literal-case': 'error',
103
- 'unicorn/prefer-includes': 'error',
104
- 'unicorn/prefer-type-error': 'error',
105
- 'unicorn/throw-new-error': 'error',
106
- 'unicorn/no-unnecessary-await': 'error',
107
- 'unicorn/switch-case-braces': ['error', 'avoid'],
108
- 'unicorn/no-typeof-undefined': 'error',
109
- 'unicorn/prefer-set-size': 'error',
110
- 'unicorn/better-regex': 'error',
111
- 'unicorn/custom-error-definition': 'error',
112
- 'unicorn/explicit-length-check': 'error',
113
- 'unicorn/new-for-builtins': 'error',
114
- 'unicorn/no-console-spaces': 'error',
115
- 'unicorn/no-for-loop': 'error',
116
- 'unicorn/no-hex-escape': 'error',
117
- 'unicorn/no-lonely-if': 'error',
118
- 'unicorn/prefer-keyboard-event-key': 'error',
119
- 'unicorn/prefer-math-trunc': 'error',
120
- 'unicorn/prefer-negative-index': 'error',
121
- 'unicorn/prefer-node-protocol': 'error',
122
- 'unicorn/prefer-number-properties': 'error',
123
- 'unicorn/prefer-optional-catch-binding': 'error',
124
- 'unicorn/prefer-prototype-methods': 'error',
125
- 'unicorn/prefer-reflect-apply': 'error',
126
-
127
- 'unicorn/prefer-date-now': 'error',
128
-
129
- // String
130
- 'unicorn/prefer-string-slice': 'error',
131
- 'unicorn/prefer-string-trim-start-end': 'error',
132
- 'unicorn/prefer-string-starts-ends-with': 'error',
133
-
134
- // DOM
135
- 'unicorn/prefer-add-event-listener': 'error',
136
- 'unicorn/no-invalid-remove-event-listener': 'error',
137
- 'unicorn/prefer-query-selector': 'error',
138
- 'unicorn/prefer-modern-dom-apis': 'error',
139
- 'unicorn/prefer-dom-node-append': 'error',
140
- 'unicorn/prefer-dom-node-dataset': 'error',
141
- 'unicorn/prefer-dom-node-remove': 'error',
142
- 'unicorn/prefer-dom-node-text-content': 'error',
143
-
144
- // Array
145
- 'unicorn/no-new-array': 'error',
146
- 'unicorn/no-instanceof-array': 'error',
147
- 'unicorn/no-array-push-push': 'error',
148
- 'unicorn/no-array-callback-reference': 'error',
149
- 'unicorn/no-array-method-this-argument': 'error',
150
- 'unicorn/prefer-array-find': 'error',
151
- 'unicorn/prefer-array-some': 'error',
152
- 'unicorn/prefer-array-flat-map': 'error',
153
- 'unicorn/prefer-array-index-of': 'error',
154
- },
155
- },
156
- ]
package/lib/jsonc.js DELETED
@@ -1,115 +0,0 @@
1
- import jsoncPlugin, { configs } from 'eslint-plugin-jsonc'
2
- import jsoncParser from 'jsonc-eslint-parser'
3
- import { GLOB_EXCLUDE, GLOB_JSON, GLOB_JSON5, GLOB_JSONC } from './shared.js'
4
-
5
- /** @type {import('eslint-define-config').FlatESLintConfig[]} */
6
- export const jsonc = [
7
- {
8
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, '**/*rc'],
9
- ignores: GLOB_EXCLUDE,
10
- plugins: {
11
- jsonc: jsoncPlugin,
12
- },
13
- languageOptions: {
14
- parser: jsoncParser,
15
- },
16
- rules: {
17
- ...configs['recommended-with-jsonc'].rules,
18
- 'jsonc/array-bracket-spacing': ['error', 'never'],
19
- 'jsonc/comma-dangle': ['error', 'never'],
20
- 'jsonc/comma-style': ['error', 'last'],
21
- 'jsonc/indent': ['error', 2],
22
- 'jsonc/key-spacing': [
23
- 'error',
24
- {
25
- beforeColon: false,
26
- afterColon: true,
27
- },
28
- ],
29
- 'jsonc/no-octal-escape': 'error',
30
- 'jsonc/object-curly-newline': [
31
- 'error',
32
- {
33
- multiline: true,
34
- consistent: true,
35
- },
36
- ],
37
- 'jsonc/object-curly-spacing': ['error', 'always'],
38
- 'jsonc/object-property-newline': [
39
- 'error',
40
- {
41
- allowMultiplePropertiesPerLine: true,
42
- },
43
- ],
44
- },
45
- },
46
- ]
47
-
48
- /** @type {import('eslint-define-config').FlatESLintConfig[]} */
49
- export const pkgOrder = [
50
- {
51
- files: ['**/package.json'],
52
- rules: {
53
- 'jsonc/sort-keys': [
54
- 'error',
55
- {
56
- pathPattern: '^$',
57
- order: [
58
- 'name',
59
- 'type',
60
- 'version',
61
- 'private',
62
- 'packageManager',
63
- 'publisher',
64
- 'displayName',
65
- 'description',
66
- 'keywords',
67
- 'license',
68
- 'author',
69
- 'homepage',
70
- 'repository',
71
- 'funding',
72
- 'main',
73
- 'module',
74
- 'types',
75
- 'unpkg',
76
- 'jsdelivr',
77
- 'exports',
78
- 'files',
79
- 'bin',
80
- 'icon',
81
- 'sideEffects',
82
- 'scripts',
83
- 'peerDependencies',
84
- 'peerDependenciesMeta',
85
- 'dependencies',
86
- 'optionalDependencies',
87
- 'devDependencies',
88
- 'activationEvents',
89
- 'contributes',
90
- 'categories',
91
- 'engines',
92
- 'pnpm',
93
- 'husky',
94
- 'prettier',
95
- 'nano-staged',
96
- 'lint-staged',
97
- 'eslintConfig',
98
- ],
99
- },
100
- {
101
- pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies$',
102
- order: { type: 'asc' },
103
- },
104
- {
105
- pathPattern: '^exports.*$',
106
- order: ['types', 'require', 'import'],
107
- },
108
- {
109
- pathPattern: '^scripts$',
110
- order: { type: 'asc' },
111
- },
112
- ],
113
- },
114
- },
115
- ]
package/lib/markdown.js DELETED
@@ -1,44 +0,0 @@
1
- import markdownPlugin from 'eslint-plugin-markdown'
2
- import { GLOB_EXCLUDE, GLOB_MARKDOWN } from './shared.js'
3
-
4
- /** @type {import('eslint-define-config').FlatESLintConfig[]} */
5
- export const markdown = [
6
- {
7
- files: [GLOB_MARKDOWN],
8
- ignores: GLOB_EXCLUDE,
9
- plugins: {
10
- markdown: markdownPlugin,
11
- },
12
- processor: 'markdown/markdown',
13
- },
14
- {
15
- files: ['**/*.md/*'],
16
- languageOptions: {
17
- parserOptions: {
18
- ecmaFeatures: {
19
- impliedStrict: true,
20
- },
21
- },
22
- },
23
- rules: {
24
- ...markdownPlugin.configs.recommended.overrides[1].rules,
25
- 'no-undef': 'off',
26
- 'no-alert': 'off',
27
- 'no-console': 'off',
28
- 'no-unused-vars': 'off',
29
- 'no-unused-expressions': 'off',
30
- 'no-restricted-imports': 'off',
31
-
32
- 'import/no-unresolved': 'off',
33
-
34
- '@typescript-eslint/comma-dangle': 'off',
35
- '@typescript-eslint/no-redeclare': 'off',
36
- '@typescript-eslint/no-unused-vars': 'off',
37
- '@typescript-eslint/no-var-requires': 'off',
38
- '@typescript-eslint/no-use-before-define': 'off',
39
-
40
- 'unused-imports/no-unused-imports': 'off',
41
- 'unused-imports/no-unused-vars': 'off',
42
- },
43
- },
44
- ]
package/lib/presets.js DELETED
@@ -1,24 +0,0 @@
1
- import jsConfig from '@eslint/js'
2
- import { ts } from './ts.js'
3
- import { yml } from './yml.js'
4
- import { vue } from './vue.js'
5
- import { markdown } from './markdown.js'
6
- import { jsonc, pkgOrder } from './jsonc.js'
7
- import { imports, js, jsx, unicorn } from './js.js'
8
- import { eslintComments } from './eslint-comments.js'
9
-
10
- /** @type {import('eslint-define-config').FlatESLintConfig[]} */
11
- export const presetBasic = [
12
- jsConfig.configs.recommended,
13
- ...js,
14
- ...jsx,
15
- ...ts,
16
- ...vue,
17
- ...yml,
18
- ...imports,
19
- ...unicorn,
20
- ...jsonc,
21
- ...pkgOrder,
22
- ...markdown,
23
- ...eslintComments,
24
- ]
package/lib/prettier.js DELETED
@@ -1,19 +0,0 @@
1
- import prettierPlugin from 'eslint-plugin-prettier'
2
- import prettierConfig from 'eslint-config-prettier'
3
-
4
- const prettierConflictRules = { ...prettierConfig.rules }
5
- delete prettierConflictRules['vue/html-self-closing']
6
-
7
- /** @type {import('eslint-define-config').FlatESLintConfigItem[]} */
8
- export const prettier = [
9
- {
10
- plugins: {
11
- prettier: prettierPlugin,
12
- },
13
- rules: {
14
- ...prettierConflictRules,
15
- ...prettierPlugin.configs.recommended.rules,
16
- 'prettier/prettier': 'warn',
17
- },
18
- },
19
- ]
package/lib/shared.js DELETED
@@ -1,61 +0,0 @@
1
- // @ts-check
2
-
3
- export const GLOB_SRC = '**/*.?([mt])[jt]s?(x)'
4
-
5
- export const GLOB_JS = '**/*.?([mt])js'
6
- export const GLOB_JSX = '**/*.?([mt])jsx'
7
-
8
- export const GLOB_TS = '**/*.?([mt])ts'
9
- export const GLOB_TSX = '**/*.?([mt])tsx'
10
-
11
- export const GLOB_STYLE = '**/*.{c,le,sc}ss'
12
- export const GLOB_CSS = '**/*.css'
13
- export const GLOB_LESS = '**/*.less'
14
- export const GLOB_SCSS = '**/*.scss'
15
-
16
- export const GLOB_JSON = '**/*.json'
17
- export const GLOB_JSON5 = '**/*.json5'
18
- export const GLOB_JSONC = '**/*.jsonc'
19
-
20
- export const GLOB_VUE = '**/*.vue'
21
- export const GLOB_ASTRO = '**/*.astro'
22
-
23
- export const GLOB_MARKDOWN = '**/*.md'
24
- export const GLOB_YAML = '**/*.y?(a)ml'
25
- export const GLOB_HTML = '**/*.htm?(l)'
26
-
27
- export const GLOB_ALL_SRC = /** @type {const} */ ([
28
- GLOB_SRC,
29
- GLOB_STYLE,
30
- GLOB_JSON,
31
- GLOB_JSON5,
32
- GLOB_MARKDOWN,
33
- GLOB_VUE,
34
- GLOB_YAML,
35
- GLOB_HTML,
36
- ])
37
-
38
- export const GLOB_NODE_MODULES = /** @type {const} */ ('**/node_modules/**')
39
- export const GLOB_DIST = /** @type {const} */ ('**/dist/**')
40
- export const GLOB_LOCKFILE = /** @type {const} */ ([
41
- '**/package-lock.json',
42
- '**/yarn.lock',
43
- '**/pnpm-lock.yaml',
44
- ])
45
- export const GLOB_EXCLUDE = /** @type {const} */ ([
46
- GLOB_NODE_MODULES,
47
- GLOB_DIST,
48
- ...GLOB_LOCKFILE,
49
- '**/CHANGELOG*.md',
50
- '**/*.min.*',
51
- '**/LICENSE*',
52
- '**/output',
53
- '**/coverage',
54
- '**/temp',
55
- '**/fixtures',
56
- '**/__snapshots__',
57
- '**/auto-import.d.ts',
58
- '**/components.d.ts',
59
- '**/.npmrc',
60
- '**/.yarnrc',
61
- ])