eslint-config-arklint 3.3.2 → 4.0.0

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/README.md CHANGED
@@ -12,12 +12,11 @@ yarn add eslint eslint-config-arklint -D
12
12
  ## Usage
13
13
 
14
14
  > [!WARNING]
15
- > Only **flat config** is supported, either CJS or ESM.
15
+ > Only **ESM flat config** is supported.
16
+ > If your project uses CJS, you need to use the `.mjs` extension on your ESLint config file.
16
17
 
17
18
  The default configuration includes standards and stylistic rules for JS. Optional extensions can be added to add rules for `import`, `react` and `jsdoc`:
18
19
 
19
- **ESM**
20
-
21
20
  ```js
22
21
  import arklintConfig from "eslint-config-arklint";
23
22
  import extensions from "eslint-config-arklint/extensions";
@@ -31,17 +30,3 @@ export default [
31
30
  ...jsdocConfig
32
31
  ];
33
32
  ```
34
-
35
- **CJS**
36
-
37
- ```js
38
- const arklintConfig = require("eslint-config-arklint");
39
- const { importConfig, reactConfig, jsdocConfig } = require("eslint-config-arklint/extensions");
40
-
41
- module.exports = [
42
- ...arklintConfig,
43
- ...reactConfig,
44
- ...importConfig,
45
- ...jsdocConfig
46
- ];
47
- ```
package/package.json CHANGED
@@ -1,21 +1,18 @@
1
1
  {
2
2
  "name": "eslint-config-arklint",
3
- "version": "3.3.2",
3
+ "version": "4.0.0",
4
4
  "author": "Arkellys",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {
9
- "require": "./cjs/index.cjs",
10
9
  "import": "./index.mjs"
11
10
  },
12
11
  "./extensions": {
13
- "require": "./cjs/extensions/index.cjs",
14
12
  "import": "./extensions/index.mjs"
15
13
  }
16
14
  },
17
15
  "files": [
18
- "cjs",
19
16
  "extensions",
20
17
  "index.mjs"
21
18
  ],
@@ -26,31 +23,25 @@
26
23
  "homepage": "https://github.com/Arkellys/eslint-config-arklint#readme",
27
24
  "scripts": {
28
25
  "lint": "eslint .",
29
- "build:main": "babel index.mjs --out-dir cjs --out-file-extension .cjs",
30
- "build:extensions": "babel extensions --out-dir cjs/extensions --out-file-extension .cjs",
31
- "build": "rm -rf cjs && yarn build:main && yarn build:extensions",
32
26
  "prepare": "husky"
33
27
  },
34
28
  "dependencies": {
35
- "@babel/core": "^7.26.0",
36
- "@babel/eslint-parser": "^7.26.5",
37
- "@babel/preset-env": "^7.26.0",
29
+ "@babel/core": "^7.26.10",
30
+ "@babel/eslint-parser": "^7.27.0",
31
+ "@babel/preset-env": "^7.26.9",
38
32
  "@babel/preset-react": "^7.26.3",
39
- "@eslint/js": "^9.18.0",
40
- "@stylistic/eslint-plugin-js": "^2.13.0",
33
+ "@eslint/js": "^9.25.0",
34
+ "@stylistic/eslint-plugin-js": "^4.2.0",
41
35
  "eslint-plugin-import": "^2.31.0",
42
- "eslint-plugin-jsdoc": "^50.6.2",
36
+ "eslint-plugin-jsdoc": "^50.6.9",
43
37
  "eslint-plugin-jsx-a11y": "^6.10.2",
44
- "eslint-plugin-perfectionist": "^4.6.0",
45
- "eslint-plugin-react": "^7.37.4",
46
- "eslint-plugin-react-hooks": "^5.1.0",
47
- "globals": "^15.14.0"
38
+ "eslint-plugin-perfectionist": "^4.11.0",
39
+ "eslint-plugin-react": "^7.37.5",
40
+ "eslint-plugin-react-hooks": "^5.2.0",
41
+ "globals": "^16.0.0"
48
42
  },
49
43
  "devDependencies": {
50
- "@babel/cli": "^7.26.4",
51
- "babel-plugin-transform-esm-to-cjs": "^0.0.0",
52
- "babel-plugin-transform-import-extension": "^1.0.3",
53
- "eslint": "^9.18.0",
44
+ "eslint": "^9.25.0",
54
45
  "husky": "^9.1.7"
55
46
  },
56
47
  "peerDependencies": {
@@ -1,27 +0,0 @@
1
- var importPlugin = require("eslint-plugin-import");
2
- var perfectionistPlugin = require("eslint-plugin-perfectionist");
3
- module.exports = [importPlugin.flatConfigs.recommended, {
4
- plugins: {
5
- perfectionist: perfectionistPlugin
6
- },
7
- rules: {
8
- "import/no-named-as-default-member": "off",
9
- "import/no-anonymous-default-export": "off",
10
- "import/newline-after-import": ["warn", {
11
- count: 2,
12
- considerComments: true
13
- }],
14
- "import/first": "error",
15
- "import/no-amd": "error",
16
- "import/no-webpack-loader-syntax": "error",
17
- "import/no-unresolved": ["error", {
18
- commonjs: true
19
- }],
20
- "perfectionist/sort-exports": "warn",
21
- "perfectionist/sort-named-exports": "warn",
22
- "perfectionist/sort-named-imports": "warn",
23
- "perfectionist/sort-imports": ["warn", {
24
- groups: ["type", "unknown", "builtin", "external", "internal", "parent", ["index", "sibling", "style"]]
25
- }]
26
- }
27
- }];
@@ -1,8 +0,0 @@
1
- var importConfig = require("./import.cjs");
2
- var jsdocConfig = require("./jsdoc.cjs");
3
- var reactConfig = require("./react.cjs");
4
- module.exports = {
5
- importConfig,
6
- jsdocConfig,
7
- reactConfig
8
- };
@@ -1,82 +0,0 @@
1
- var jsdocPlugin = require("eslint-plugin-jsdoc");
2
- module.exports = [jsdocPlugin.configs["flat/recommended-typescript-flavor"], {
3
- plugins: {
4
- jsdoc: jsdocPlugin
5
- },
6
- settings: {
7
- jsdoc: {
8
- maxLines: 2,
9
- mode: "typescript",
10
- preferredTypes: {
11
- "object<>": false,
12
- "Object<>": "Record<>",
13
- "Object": "object",
14
- ".<>": "<>",
15
- "*": "any"
16
- }
17
- }
18
- },
19
- rules: {
20
- "jsdoc/check-param-names": "warn",
21
- "jsdoc/check-template-names": "warn",
22
- "jsdoc/lines-before-block": "warn",
23
- "jsdoc/require-jsdoc": "off",
24
- "jsdoc/require-returns": "off",
25
- "jsdoc/require-template": "warn",
26
- "jsdoc/check-indentation": ["warn", {
27
- excludeTags: ["import", "example"]
28
- }],
29
- "jsdoc/no-bad-blocks": "warn",
30
- "jsdoc/tag-lines": ["warn", "never"],
31
- "jsdoc/no-defaults": "off",
32
- "jsdoc/require-hyphen-before-param-description": ["warn", "always", {
33
- tags: {
34
- property: "always",
35
- template: "always",
36
- return: "never"
37
- }
38
- }],
39
- "jsdoc/check-line-alignment": ["warn", "never"],
40
- "jsdoc/match-name": ["warn", {
41
- match: [{
42
- allowName: "/^_?([A-Z][a-z]+)+$/",
43
- message: "The name should be written in PascalCase.",
44
- tags: ["typedef"]
45
- }, {
46
- allowName: "/^([A-Z][a-z]+)+$/",
47
- message: "The name should be written in PascalCase.",
48
- tags: ["callback"]
49
- }, {
50
- allowName: "/^[A-Z]{1}$/",
51
- message: "The name should be a single capital letter.",
52
- tags: ["template"]
53
- }]
54
- }],
55
- "jsdoc/match-description": ["warn", {
56
- contexts: ["any"],
57
- mainDescription: {
58
- message: "The main description should be written in the third person, begin with a capital letter and end with a period.",
59
- match: "/^[A-Z][.^\\w]*s\\b.*\\.$/us"
60
- },
61
- matchDescription: "^[A-Z].*[^\\.]$",
62
- tags: {
63
- param: {
64
- message: "@param description should begin with a capital letter and not end with a period.",
65
- match: true
66
- },
67
- property: {
68
- message: "@property description should begin with a capital letter and not end with a period.",
69
- match: true
70
- },
71
- returns: {
72
- message: "@returns description should begin with a capital letter and not end with a period.",
73
- match: true
74
- },
75
- template: {
76
- message: "@template description should begin with a capital letter and not end with a period.",
77
- match: true
78
- }
79
- }
80
- }]
81
- }
82
- }];
@@ -1,84 +0,0 @@
1
- var jsxA11yPlugin = require("eslint-plugin-jsx-a11y");
2
- var reactPlugin = require("eslint-plugin-react");
3
- var reactHooksPlugin = require("eslint-plugin-react-hooks");
4
- module.exports = [reactPlugin.configs.flat.recommended, reactPlugin.configs.flat["jsx-runtime"], {
5
- plugins: {
6
- "react": reactPlugin,
7
- "react-hooks": reactHooksPlugin,
8
- "jsx-a11y": jsxA11yPlugin
9
- },
10
- languageOptions: {
11
- parserOptions: {
12
- ecmaFeatures: {
13
- jsx: true
14
- },
15
- babelOptions: {
16
- presets: ["@babel/preset-react"]
17
- }
18
- }
19
- },
20
- settings: {
21
- react: {
22
- version: "detect"
23
- }
24
- },
25
- rules: {
26
- "jsx-a11y/alt-text": "warn",
27
- "jsx-a11y/anchor-has-content": "warn",
28
- "jsx-a11y/anchor-is-valid": ["warn", {
29
- aspects: ["noHref", "invalidHref"]
30
- }],
31
- "jsx-a11y/aria-activedescendant-has-tabindex": "warn",
32
- "jsx-a11y/aria-props": "warn",
33
- "jsx-a11y/aria-proptypes": "warn",
34
- "jsx-a11y/aria-role": ["warn", {
35
- ignoreNonDOM: true
36
- }],
37
- "jsx-a11y/aria-unsupported-elements": "warn",
38
- "jsx-a11y/heading-has-content": "warn",
39
- "jsx-a11y/iframe-has-title": "warn",
40
- "jsx-a11y/img-redundant-alt": "warn",
41
- "jsx-a11y/no-access-key": "warn",
42
- "jsx-a11y/no-distracting-elements": "warn",
43
- "jsx-a11y/no-redundant-roles": "warn",
44
- "jsx-a11y/role-has-required-aria-props": "warn",
45
- "jsx-a11y/role-supports-aria-props": "warn",
46
- "jsx-a11y/scope": "warn",
47
- "react/display-name": "warn",
48
- "react-hooks/exhaustive-deps": "warn",
49
- "react-hooks/rules-of-hooks": "error",
50
- "react/jsx-curly-brace-presence": "warn",
51
- "react/jsx-first-prop-new-line": ["warn", "multiline"],
52
- "react/jsx-fragments": ["warn", "element"],
53
- "react/jsx-key": "warn",
54
- "react/jsx-max-props-per-line": ["warn", {
55
- maximum: {
56
- single: 3,
57
- multi: 1
58
- }
59
- }],
60
- "react/jsx-no-comment-textnodes": "warn",
61
- "react/jsx-no-duplicate-props": "warn",
62
- "react/jsx-no-target-blank": "warn",
63
- "react/jsx-no-undef": "error",
64
- "react/jsx-pascal-case": "warn",
65
- "react/jsx-tag-spacing": ["warn", {
66
- closingSlash: "never",
67
- beforeSelfClosing: "always",
68
- afterOpening: "never",
69
- beforeClosing: "never"
70
- }],
71
- "react/jsx-uses-react": "warn",
72
- "react/jsx-uses-vars": "warn",
73
- "react/jsx-boolean-value": ["warn", "never"],
74
- "react/jsx-closing-bracket-location": "warn",
75
- "react/jsx-wrap-multilines": "warn",
76
- "react/jsx-props-no-spread-multi": "warn",
77
- "react/no-danger-with-children": "warn",
78
- "react/no-direct-mutation-state": "warn",
79
- "react/no-is-mounted": "warn",
80
- "react/prop-types": "off",
81
- "react/require-render-return": "error",
82
- "react/style-prop-object": "warn"
83
- }
84
- }];
package/cjs/index.cjs DELETED
@@ -1,204 +0,0 @@
1
- var babelParser = require("@babel/eslint-parser");
2
- var js = require("@eslint/js");
3
- var stylisticJsPlugin = require("@stylistic/eslint-plugin-js");
4
- var globals = require("globals");
5
- module.exports = [{
6
- files: ["**/*.{js,mjs,cjs,jsx}"]
7
- }, {
8
- languageOptions: {
9
- globals: {
10
- ...globals.browser,
11
- ...globals.commonjs,
12
- ...globals.node,
13
- ...globals.es2025
14
- },
15
- parser: babelParser,
16
- parserOptions: {
17
- requireConfigFile: false,
18
- ecmaVersion: "latest",
19
- babelOptions: {
20
- babelrc: false,
21
- configFile: false,
22
- presets: ["@babel/preset-env"]
23
- }
24
- }
25
- }
26
- }, js.configs.recommended, {
27
- plugins: {
28
- "@stylistic/js": stylisticJsPlugin
29
- },
30
- rules: {
31
- "array-callback-return": "warn",
32
- "arrow-body-style": "warn",
33
- "camelcase": "warn",
34
- "default-case": ["warn", {
35
- commentPattern: "^no default$"
36
- }],
37
- "dot-notation": "warn",
38
- "eqeqeq": ["warn", "smart"],
39
- "getter-return": "warn",
40
- "no-array-constructor": "warn",
41
- "no-async-promise-executor": "off",
42
- "no-caller": "warn",
43
- "no-case-declarations": "off",
44
- "no-cond-assign": ["warn", "except-parens"],
45
- "no-const-assign": "warn",
46
- "no-control-regex": "warn",
47
- "no-delete-var": "warn",
48
- "no-dupe-args": "warn",
49
- "no-dupe-class-members": "warn",
50
- "no-dupe-keys": "warn",
51
- "no-duplicate-case": "warn",
52
- "no-duplicate-imports": "warn",
53
- "no-empty-character-class": "warn",
54
- "no-empty-pattern": "warn",
55
- "no-eval": "warn",
56
- "no-ex-assign": "warn",
57
- "no-extend-native": "warn",
58
- "no-extra-bind": "warn",
59
- "no-extra-label": "warn",
60
- "no-extra-semi": "off",
61
- "no-fallthrough": "warn",
62
- "no-func-assign": "warn",
63
- "no-global-assign": "warn",
64
- "no-implied-eval": "warn",
65
- "no-invalid-regexp": "warn",
66
- "no-iterator": "warn",
67
- "no-label-var": "warn",
68
- "no-labels": ["warn", {
69
- allowLoop: true,
70
- allowSwitch: false
71
- }],
72
- "no-lone-blocks": "warn",
73
- "no-loop-func": "warn",
74
- "no-multi-str": "warn",
75
- "no-new-func": "warn",
76
- "no-new-object": "warn",
77
- "no-new-symbol": "warn",
78
- "no-new-wrappers": "warn",
79
- "no-obj-calls": "warn",
80
- "no-octal-escape": "warn",
81
- "no-octal": "warn",
82
- "no-redeclare": "warn",
83
- "no-regex-spaces": "warn",
84
- "no-restricted-globals": ["error", "addEventListener", "blur", "close", "closed", "confirm", "event", "external", "focus", "frameElement", "frames", "history", "innerHeight", "innerWidth", "length", "location", "locationbar", "menubar", "moveBy", "moveTo", "name", "onblur", "onerror", "onfocus", "onload", "onresize", "onunload", "open", "opener", "outerHeight", "outerWidth", "pageXOffset", "pageYOffset", "parent", "print", "removeEventListener", "resizeBy", "resizeTo", "screen", "screenLeft", "screenTop", "screenX", "screenY", "scroll", "scrollbars", "scrollBy", "scrollTo", "scrollX", "scrollY", "self", "status", "statusbar", "stop", "toolbar", "top"],
85
- "no-restricted-syntax": ["warn", "WithStatement"],
86
- "no-script-url": "warn",
87
- "no-self-assign": "warn",
88
- "no-self-compare": "warn",
89
- "no-sequences": "warn",
90
- "no-shadow-restricted-names": "warn",
91
- "no-sparse-arrays": "warn",
92
- "no-template-curly-in-string": "warn",
93
- "no-this-before-super": "warn",
94
- "no-undef": "error",
95
- "no-unreachable": "warn",
96
- "no-unsafe-negation": "warn",
97
- "no-unused-expressions": ["error", {
98
- allowShortCircuit: true,
99
- allowTernary: true,
100
- allowTaggedTemplates: true
101
- }],
102
- "no-unused-labels": "warn",
103
- "no-unused-vars": ["warn", {
104
- caughtErrorsIgnorePattern: "^_"
105
- }],
106
- "no-use-before-define": ["warn", {
107
- functions: false,
108
- classes: false,
109
- variables: false
110
- }],
111
- "no-useless-escape": "warn",
112
- "no-useless-computed-key": "warn",
113
- "no-useless-concat": "warn",
114
- "no-useless-constructor": "warn",
115
- "no-useless-rename": "warn",
116
- "no-var": "warn",
117
- "no-with": "warn",
118
- "object-shorthand": ["warn", "always"],
119
- "prefer-arrow-callback": "warn",
120
- "require-await": "warn",
121
- "require-yield": "warn",
122
- "strict": ["warn", "never"],
123
- "unicode-bom": ["warn", "never"],
124
- "use-isnan": "warn",
125
- "valid-typeof": "warn",
126
- "@stylistic/js/array-bracket-newline": ["warn", "consistent"],
127
- "@stylistic/js/array-bracket-spacing": "warn",
128
- "@stylistic/js/array-element-newline": ["warn", "consistent"],
129
- "@stylistic/js/arrow-parens": "warn",
130
- "@stylistic/js/arrow-spacing": "warn",
131
- "@stylistic/js/block-spacing": "warn",
132
- "@stylistic/js/brace-style": ["warn", "1tbs", {
133
- allowSingleLine: true
134
- }],
135
- "@stylistic/js/comma-dangle": ["warn", "never"],
136
- "@stylistic/js/comma-spacing": "warn",
137
- "@stylistic/js/comma-style": "warn",
138
- "@stylistic/js/computed-property-spacing": "warn",
139
- "@stylistic/js/dot-location": ["warn", "property"],
140
- "@stylistic/js/eol-last": ["warn", "never"],
141
- "@stylistic/js/function-call-spacing": "warn",
142
- "@stylistic/js/function-call-argument-newline": ["warn", "consistent"],
143
- "@stylistic/js/function-paren-newline": ["warn", "consistent"],
144
- "@stylistic/js/implicit-arrow-linebreak": "warn",
145
- "@stylistic/js/indent": ["warn", "tab", {
146
- SwitchCase: 1,
147
- ignoreComments: true
148
- }],
149
- "@stylistic/js/key-spacing": "warn",
150
- "@stylistic/js/keyword-spacing": "warn",
151
- "@stylistic/js/new-parens": "warn",
152
- "@stylistic/js/no-confusing-arrow": "warn",
153
- "@stylistic/js/no-extra-semi": "warn",
154
- "@stylistic/js/no-floating-decimal": "warn",
155
- "@stylistic/js/no-mixed-operators": "warn",
156
- "@stylistic/js/no-multi-spaces": "warn",
157
- "@stylistic/js/no-multiple-empty-lines": ["warn", {
158
- max: 2,
159
- maxBOF: 0,
160
- maxEOF: 0
161
- }],
162
- "@stylistic/js/no-trailing-spaces": "warn",
163
- "@stylistic/js/no-whitespace-before-property": "warn",
164
- "@stylistic/js/nonblock-statement-body-position": "warn",
165
- "@stylistic/js/object-curly-newline": "warn",
166
- "@stylistic/js/object-curly-spacing": ["warn", "always"],
167
- "@stylistic/js/operator-linebreak": ["warn", "after", {
168
- overrides: {
169
- "?": "ignore",
170
- ":": "ignore",
171
- "||": "ignore",
172
- "&&": "ignore"
173
- }
174
- }],
175
- "@stylistic/js/padding-line-between-statements": ["warn", {
176
- blankLine: "always",
177
- prev: "default",
178
- next: "*"
179
- }, {
180
- blankLine: "always",
181
- prev: "*",
182
- next: "switch"
183
- }],
184
- "@stylistic/js/quote-props": ["warn", "consistent-as-needed"],
185
- "@stylistic/js/quotes": ["warn", "double"],
186
- "@stylistic/js/rest-spread-spacing": "warn",
187
- "@stylistic/js/semi": "warn",
188
- "@stylistic/js/semi-spacing": "warn",
189
- "@stylistic/js/semi-style": "warn",
190
- "@stylistic/js/space-before-blocks": "warn",
191
- "@stylistic/js/space-before-function-paren": ["warn", {
192
- anonymous: "always",
193
- named: "never",
194
- asyncArrow: "always"
195
- }],
196
- "@stylistic/js/space-in-parens": "warn",
197
- "@stylistic/js/space-infix-ops": "warn",
198
- "@stylistic/js/space-unary-ops": "warn",
199
- "@stylistic/js/spaced-comment": "warn",
200
- "@stylistic/js/template-curly-spacing": "warn"
201
- }
202
- }, {
203
- ignores: [".yarn/"]
204
- }];