@markuplint-dev/eslint-config 1.0.1 → 1.0.3

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/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [1.0.1](https://github.com/markuplint/markuplint/compare/@markuplint-dev/eslint-config@1.0.0...@markuplint-dev/eslint-config@1.0.1) (2024-06-25)
6
+ ## [1.0.3](https://github.com/markuplint/markuplint/compare/@markuplint-dev/eslint-config@1.0.2...@markuplint-dev/eslint-config@1.0.3) (2024-09-23)
7
7
 
8
8
  **Note:** Version bump only for package @markuplint-dev/eslint-config
9
9
 
@@ -11,6 +11,21 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
+ ## [1.0.2](https://github.com/markuplint/markuplint/compare/@markuplint-dev/eslint-config@1.0.1...@markuplint-dev/eslint-config@1.0.2) (2024-09-02)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **eslint-config:** fix setting for test file extension ([d5c1022](https://github.com/markuplint/markuplint/commit/d5c1022e320383aad8cc5d36bc9659869e644831))
20
+
21
+
22
+
23
+
24
+
25
+ ## [1.0.1](https://github.com/markuplint/markuplint/compare/@markuplint-dev/eslint-config@1.0.0...@markuplint-dev/eslint-config@1.0.1) (2024-06-25)
26
+
27
+ **Note:** Version bump only for package @markuplint-dev/eslint-config
28
+
14
29
  # 1.0.0 (2024-06-09)
15
30
 
16
31
  ### Bug Fixes
package/base.js CHANGED
@@ -1,105 +1,82 @@
1
+ import js from '@eslint/js';
2
+ import unicorn from 'eslint-plugin-unicorn';
3
+ import tsESLint from 'typescript-eslint';
4
+ import jsdoc from 'eslint-plugin-jsdoc';
5
+ import sortClassMembers from 'eslint-plugin-sort-class-members';
6
+ import globals from 'globals';
7
+ import * as regexp from 'eslint-plugin-regexp';
8
+
1
9
  /**
2
10
  * @type {import('eslint').Linter.Config}
3
11
  */
4
- module.exports = {
5
- extends: [
6
- 'eslint:recommended',
7
- 'plugin:unicorn/recommended',
8
- 'plugin:regexp/recommended',
9
- 'plugin:import/recommended',
10
- 'plugin:@eslint-community/eslint-comments/recommended',
11
- 'plugin:import/typescript',
12
- ],
13
- env: {
14
- browser: false,
15
- es6: true,
16
- node: true,
17
- commonjs: false,
18
- },
19
- plugins: ['unicorn', '@typescript-eslint', 'jsdoc', 'import', 'sort-class-members'],
20
- parserOptions: {
21
- ecmaVersion: 13,
22
- },
23
- rules: {
24
- indent: 0,
25
- quotes: [2, 'single', 'avoid-escape'],
26
- 'no-var': 2,
27
- 'prefer-const': 2,
28
- 'no-dupe-class-members': 0,
29
- 'no-unused-vars': 0,
30
- 'no-array-constructor': 0,
31
- 'sort-imports': 0,
32
- 'no-console': [1],
33
- 'no-mixed-spaces-and-tabs': 0,
34
- 'require-await': 2,
35
- 'lines-between-class-members': [1, 'always', { exceptAfterSingleLine: true }],
36
- 'no-restricted-globals': [2, '__dirname', 'require'],
37
-
38
- 'node/no-unsupported-features/es-syntax': 0,
12
+ export const base = [
13
+ js.configs.recommended,
14
+ ...tsESLint.configs.recommended,
15
+ unicorn.configs['flat/recommended'],
16
+ regexp.configs['flat/recommended'],
17
+ sortClassMembers.configs['flat/recommended'],
18
+ {
19
+ plugins: {
20
+ jsdoc,
21
+ },
22
+ languageOptions: {
23
+ globals: {
24
+ ...globals.node,
25
+ },
26
+ parserOptions: {
27
+ ecmaVersion: 13,
28
+ },
29
+ },
30
+ rules: {
31
+ indent: 0,
32
+ quotes: [2, 'single', 'avoid-escape'],
33
+ 'no-var': 2,
34
+ 'prefer-const': 2,
35
+ 'no-dupe-class-members': 0,
36
+ 'no-unused-vars': 0,
37
+ 'no-array-constructor': 0,
38
+ 'sort-imports': 0,
39
+ 'no-console': [1],
40
+ 'no-mixed-spaces-and-tabs': 0,
41
+ 'require-await': 2,
42
+ 'lines-between-class-members': [1, 'always', { exceptAfterSingleLine: true }],
43
+ 'no-restricted-globals': [2, '__dirname', 'require'],
39
44
 
40
- 'unicorn/consistent-destructuring': 0,
41
- 'unicorn/consistent-function-scoping': 0,
42
- 'unicorn/no-array-callback-reference': 0,
43
- 'unicorn/no-nested-ternary': 0,
44
- 'unicorn/no-null': 0,
45
- 'unicorn/prefer-query-selector': 0,
46
- 'unicorn/prefer-ternary': 0,
47
- 'unicorn/prevent-abbreviations': 0,
45
+ 'node/no-unsupported-features/es-syntax': 0,
48
46
 
49
- '@eslint-community/eslint-comments/no-unused-disable': 'error',
47
+ 'unicorn/consistent-destructuring': 0,
48
+ 'unicorn/consistent-function-scoping': 0,
49
+ 'unicorn/no-array-callback-reference': 0,
50
+ 'unicorn/no-nested-ternary': 0,
51
+ 'unicorn/no-null': 0,
52
+ 'unicorn/prefer-query-selector': 0,
53
+ 'unicorn/prefer-string-raw': 0,
54
+ 'unicorn/prefer-ternary': 0,
55
+ 'unicorn/prevent-abbreviations': 0,
50
56
 
51
- 'import/no-named-as-default': 0,
52
- 'import/no-default-export': 2,
53
- 'import/order': [
54
- 'error',
55
- {
56
- groups: ['type', 'builtin', 'external', 'parent', 'sibling', 'index', 'object'],
57
- pathGroups: [
58
- {
59
- pattern: '@alias/**',
60
- group: 'parent',
61
- position: 'before',
62
- },
63
- ],
64
- alphabetize: {
65
- order: 'asc',
57
+ 'sort-class-members/sort-class-members': [
58
+ 1,
59
+ {
60
+ order: [
61
+ '[static-properties]',
62
+ '[static-methods]',
63
+ '[properties]',
64
+ '[conventional-private-properties]',
65
+ 'constructor',
66
+ '[methods]',
67
+ '[conventional-private-methods]',
68
+ ],
69
+ accessorPairPositioning: 'getThenSet',
66
70
  },
67
- 'newlines-between': 'always',
68
- },
69
- ],
70
- 'import/no-extraneous-dependencies': 2,
71
-
72
- 'sort-class-members/sort-class-members': [
73
- 1,
74
- {
75
- order: [
76
- '[static-properties]',
77
- '[static-methods]',
78
- '[properties]',
79
- '[conventional-private-properties]',
80
- 'constructor',
81
- '[methods]',
82
- '[conventional-private-methods]',
83
- ],
84
- accessorPairPositioning: 'getThenSet',
85
- },
86
- ],
87
- },
88
- settings: {
89
- jsdoc: {
90
- tagNamePreference: {
91
- param: 'arg',
92
- returns: 'return',
93
- },
94
- },
95
- 'import/parsers': {
96
- '@typescript-eslint/parser': ['.ts', '.tsx'],
71
+ ],
97
72
  },
98
- 'import/resolver': {
99
- typescript: {
100
- alwaysTryTypes: true,
101
- project: ['packages/*/tsconfig.json'],
73
+ settings: {
74
+ jsdoc: {
75
+ tagNamePreference: {
76
+ param: 'arg',
77
+ returns: 'return',
78
+ },
102
79
  },
103
80
  },
104
81
  },
105
- };
82
+ ];
package/commonjs.js ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @type {import('eslint').Linter.Config}
3
+ */
4
+ export const commonjs = {
5
+ rules: {
6
+ 'no-restricted-globals': 0,
7
+ 'unicorn/prefer-module': 0,
8
+ '@typescript-eslint/no-require-imports': 0,
9
+ },
10
+ };
@@ -0,0 +1,11 @@
1
+ import { confing } from '@markuplint-dev/eslint-config';
2
+
3
+ export default [
4
+ ...confing,
5
+ {
6
+ rules: {
7
+ 'no-restricted-globals': 0,
8
+ 'unicorn/prefer-module': 0,
9
+ },
10
+ },
11
+ ];
package/index.js CHANGED
@@ -1,36 +1,58 @@
1
- const base = require('./base');
2
- const parser = require('./parser');
3
- const test = require('./test');
4
- const ts = require('./ts');
1
+ import { base } from './base.js';
2
+ import { commonjs } from './commonjs.js';
3
+ import { parser } from './parser.js';
4
+ import { test } from './test.js';
5
+ import { ts } from './ts.js';
5
6
 
6
7
  /**
7
8
  * @type {import('eslint').Linter.Config}
8
9
  */
9
- module.exports = {
10
+ export const config = [
10
11
  ...base,
11
- overrides: [
12
- {
13
- files: ['{*,**/*}.{ts,tsx,cts,mts}'],
14
- ...mergeConfig(base, ts),
15
- },
16
- {
17
- files: ['./packages/@markuplint/**/parser.ts'],
18
- ...mergeConfig(base, ts, parser),
19
- },
20
- {
21
- files: ['{*,**/*}.spec.{js,mjs,cjs,ts}', 'vitest.config.ts'],
22
- ...mergeConfig(base, ts, test),
12
+ {
13
+ files: ['{*,**/*}.cjs'],
14
+ ...mergeConfig(commonjs),
15
+ },
16
+ {
17
+ files: ['{*,**/*}.{ts,tsx,cts,mts}', 'packages/@markuplint/file-resolver/test/fixtures/008/.markuplintrc.ts'],
18
+ ...mergeConfig(ts),
19
+ ignores: ['**/.*.ts'],
20
+ },
21
+ {
22
+ files: ['./packages/@markuplint/**/parser.ts'],
23
+ ...mergeConfig(ts, parser),
24
+ },
25
+ {
26
+ files: ['{*,**/*}.spec.{js,mjs,cjs}'],
27
+ ...mergeConfig(commonjs, test),
28
+ },
29
+ {
30
+ files: ['{*,**/*}.spec.ts', 'vitest.config.ts'],
31
+ ...mergeConfig(commonjs, ts, test),
32
+ },
33
+ {
34
+ files: ['packages/@markuplint/create-rule/scaffold/**/*'],
35
+ ...mergeConfig(ts, test, {
36
+ rules: {
37
+ 'unicorn/filename-case': 0,
38
+ },
39
+ }),
40
+ },
41
+ {
42
+ files: ['vscode/{src,test}/**/*.{ts,js}'],
43
+ rules: {
44
+ 'no-restricted-globals': 0,
45
+ 'unicorn/prefer-module': 0,
46
+ 'unicorn/prefer-top-level-await': 0,
23
47
  },
24
- {
25
- files: ['packages/@markuplint/create-rule/scaffold/**/*'],
26
- ...mergeConfig(base, ts, test, {
27
- rules: {
28
- 'unicorn/filename-case': 0,
29
- },
30
- }),
48
+ },
49
+ {
50
+ files: ['vscode/src/server/{v1,v2}.ts'],
51
+ rules: {
52
+ 'no-console': 'off',
31
53
  },
32
- ],
33
- };
54
+ },
55
+ ];
34
56
 
35
57
  /**
36
58
  *
package/package.json CHANGED
@@ -1,28 +1,29 @@
1
1
  {
2
2
  "name": "@markuplint-dev/eslint-config",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "ESLint and config for Markuplint projects",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
7
7
  "license": "MIT",
8
8
  "private": false,
9
- "type": "commonjs",
9
+ "type": "module",
10
10
  "main": "index.js",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
14
14
  "dependencies": {
15
- "@eslint-community/eslint-plugin-eslint-comments": "4.3.0",
16
- "@typescript-eslint/eslint-plugin": "7.14.1",
17
- "@typescript-eslint/parser": "7.14.1",
18
- "eslint": "8.57.0",
19
- "eslint-import-resolver-typescript": "3.6.1",
20
- "eslint-plugin-import": "2.29.1",
21
- "eslint-plugin-jsdoc": "48.4.0",
22
- "eslint-plugin-n": "17.9.0",
15
+ "@eslint-community/eslint-plugin-eslint-comments": "4.4.0",
16
+ "@typescript-eslint/eslint-plugin": "8.6.0",
17
+ "@typescript-eslint/parser": "8.6.0",
18
+ "eslint": "9.11.0",
19
+ "eslint-import-resolver-typescript": "3.6.3",
20
+ "eslint-plugin-import": "2.30.0",
21
+ "eslint-plugin-jsdoc": "50.2.4",
22
+ "eslint-plugin-n": "17.10.3",
23
23
  "eslint-plugin-regexp": "2.6.0",
24
24
  "eslint-plugin-sort-class-members": "1.20.0",
25
- "eslint-plugin-unicorn": "51.0.1"
25
+ "eslint-plugin-unicorn": "55.0.0",
26
+ "typescript-eslint": "8.6.0"
26
27
  },
27
- "gitHead": "05fdca254661ec335ff0cae4c6a11db164b032b9"
28
+ "gitHead": "05d2eabfcc41b67847c24049f12dd2b9f5ca6485"
28
29
  }
package/parser.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @type {import('eslint').Linter.Config}
3
3
  */
4
- module.exports = {
4
+ export const parser = {
5
5
  rules: {
6
6
  'sort-class-members/sort-class-members': [
7
7
  1,
@@ -91,6 +91,5 @@ module.exports = {
91
91
  accessorPairPositioning: 'getThenSet',
92
92
  },
93
93
  ],
94
- '@typescript-eslint/member-ordering': 0,
95
94
  },
96
95
  };
package/test.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @type {import('eslint').Linter.Config}
3
3
  */
4
- module.exports = {
4
+ export const test = {
5
5
  rules: {
6
6
  'unicorn/error-message': 0,
7
7
  'unicorn/no-await-expression-member': 0,
package/ts.js CHANGED
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * @type {import('eslint').Linter.Config}
3
3
  */
4
- module.exports = {
5
- parser: '@typescript-eslint/parser',
6
- parserOptions: {
7
- sourceType: 'module',
8
- project: ['./tsconfig.json', './tsconfig.test.json'],
4
+ export const ts = {
5
+ languageOptions: {
6
+ parserOptions: {
7
+ sourceType: 'module',
8
+ project: ['./tsconfig.json', './tsconfig.test.json'],
9
+ },
9
10
  },
10
11
  rules: {
11
12
  '@typescript-eslint/no-unused-vars': [2, { args: 'none' }],
@@ -31,44 +32,6 @@ module.exports = {
31
32
  allowAny: true,
32
33
  },
33
34
  ],
34
- '@typescript-eslint/member-ordering': [
35
- 'warn',
36
- {
37
- default: 'never',
38
- classes: {
39
- memberTypes: [
40
- 'public-static-field',
41
- 'protected-static-field',
42
- 'private-static-field',
43
- 'public-static-method',
44
- 'protected-static-method',
45
- 'public-static-get',
46
- 'protected-static-get',
47
- 'private-static-get',
48
- 'public-instance-field',
49
- 'protected-instance-field',
50
- 'private-instance-field',
51
- 'public-abstract-field',
52
- 'protected-abstract-field',
53
- 'public-constructor',
54
- 'protected-constructor',
55
- 'private-constructor',
56
- ['public-abstract-get', 'public-abstract-set'],
57
- ['protected-abstract-get', 'protected-abstract-set'],
58
- ['public-instance-get', 'public-instance-set'],
59
- ['protected-instance-get', 'protected-instance-set'],
60
- ['private-instance-get', 'private-instance-set'],
61
- 'public-abstract-method',
62
- 'protected-abstract-method',
63
- 'public-instance-method',
64
- 'protected-instance-method',
65
- 'private-instance-method',
66
- 'private-static-method',
67
- ],
68
- order: 'alphabetically',
69
- },
70
- },
71
- ],
72
35
  '@typescript-eslint/prefer-readonly-parameter-types': [
73
36
  'warn',
74
37
  {
@@ -77,5 +40,11 @@ module.exports = {
77
40
  treatMethodsAsReadonly: false,
78
41
  },
79
42
  ],
43
+
44
+ // Temporary disabled
45
+ '@typescript-eslint/ban-ts-comment': 0,
46
+ '@typescript-eslint/no-empty-object-type': 0,
47
+ '@typescript-eslint/no-explicit-any': 0,
48
+ '@typescript-eslint/no-unnecessary-type-constraint': 0,
80
49
  },
81
50
  };
package/.eslintrc DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "@markuplint-dev/eslint-config",
3
- "rules": {
4
- "no-restricted-globals": 0,
5
- "unicorn/prefer-module": 0
6
- }
7
- }