@atomicsmash/coding-standards 17.0.2 → 18.0.0-beta.2

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
@@ -1,5 +1,37 @@
1
1
  # @atomicsmash/coding-standards
2
2
 
3
+ ## 18.0.0-beta.2
4
+
5
+ ### Minor Changes
6
+
7
+ - [#526](https://github.com/AtomicSmash/packages/pull/526) [`45913a9`](https://github.com/AtomicSmash/packages/commit/45913a99257aabfadec1399e0c712fb3afd5f956) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Add beta flat config for ESLint
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies []:
12
+ - @atomicsmash/eslint-config@18.0.0-beta.2
13
+ - @atomicsmash/browserslist-config@18.0.0-beta.2
14
+
15
+ ## 17.0.3-beta.1
16
+
17
+ ### Patch Changes
18
+
19
+ - [#524](https://github.com/AtomicSmash/packages/pull/524) [`b7b83b5`](https://github.com/AtomicSmash/packages/commit/b7b83b5414d7e6899a5ad0805d5d47390d233a78) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Dependency updates
20
+
21
+ - Updated dependencies [[`b7b83b5`](https://github.com/AtomicSmash/packages/commit/b7b83b5414d7e6899a5ad0805d5d47390d233a78)]:
22
+ - @atomicsmash/eslint-config@17.0.3-beta.1
23
+ - @atomicsmash/browserslist-config@17.0.3-beta.1
24
+
25
+ ## 17.0.3-beta.0
26
+
27
+ ### Patch Changes
28
+
29
+ - [#519](https://github.com/AtomicSmash/packages/pull/519) [`41bea20`](https://github.com/AtomicSmash/packages/commit/41bea20b7bca144214f348ec45cdd1d608dc1c33) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Update dependencies
30
+
31
+ - Updated dependencies [[`41bea20`](https://github.com/AtomicSmash/packages/commit/41bea20b7bca144214f348ec45cdd1d608dc1c33)]:
32
+ - @atomicsmash/eslint-config@17.0.3-beta.0
33
+ - @atomicsmash/browserslist-config@17.0.3-beta.0
34
+
3
35
  ## 17.0.2
4
36
 
5
37
  ### Patch Changes
@@ -0,0 +1,165 @@
1
+ const OFF = 0;
2
+ const WARN = 1;
3
+ const ERROR = 2;
4
+
5
+ import js from "@eslint/js";
6
+ import esLintComments from "@eslint-community/eslint-plugin-eslint-comments";
7
+ import { defineConfig } from "eslint/config";
8
+ import importPlugin from "eslint-plugin-import";
9
+ import { playwrightConfigs } from "eslint-plugin-playwright";
10
+ import reactPlugin from "eslint-plugin-react";
11
+ import reactHooksPlugin from "eslint-plugin-react-hooks";
12
+ import globals from "globals";
13
+ import tseslint from "typescript-eslint";
14
+
15
+ export const config = defineConfig([
16
+ {
17
+ files: [
18
+ "**/*.js",
19
+ "**/*.cjs",
20
+ "**/*.mjs",
21
+ "**/*.ts",
22
+ "**/*.cts",
23
+ "**/*.mts",
24
+ ],
25
+ extends: [
26
+ js.configs.recommended,
27
+ esLintComments.configs.recommended,
28
+ tseslint.configs.strictTypeChecked,
29
+ tseslint.configs.stylisticTypeChecked,
30
+ importPlugin.flatConfigs.typescript,
31
+ ],
32
+ plugins: {
33
+ "@typescript-eslint": tseslint.plugin,
34
+ import: importPlugin,
35
+ },
36
+ languageOptions: {
37
+ ecmaVersion: 2022,
38
+ sourceType: "module",
39
+ globals: {
40
+ ...globals.browser,
41
+ ...globals.node,
42
+ },
43
+ parser: tseslint.parser,
44
+ parserOptions: {
45
+ projectService: true,
46
+ },
47
+ },
48
+ rules: {
49
+ "no-case-declarations": [OFF],
50
+ "import/order": [
51
+ ERROR,
52
+ {
53
+ alphabetize: {
54
+ order: "asc",
55
+ },
56
+ groups: [
57
+ "type",
58
+ "builtin",
59
+ "external",
60
+ "internal",
61
+ "parent",
62
+ ["sibling", "index"],
63
+ ],
64
+ "newlines-between": "ignore",
65
+ pathGroups: [],
66
+ pathGroupsExcludedImportTypes: [],
67
+ },
68
+ ],
69
+ "prefer-const": [ERROR],
70
+ "no-var": [ERROR],
71
+ "import/no-duplicates": WARN,
72
+ "eslint-comments/no-unused-disable": [ERROR],
73
+ "eslint-comments/require-description": [
74
+ ERROR,
75
+ { ignore: ["eslint-enable"] },
76
+ ],
77
+ "@typescript-eslint/naming-convention": [
78
+ ERROR,
79
+ {
80
+ selector: "variableLike",
81
+ format: ["camelCase", "PascalCase", "UPPER_CASE"],
82
+ leadingUnderscore: "allow",
83
+ },
84
+ { selector: "function", format: ["camelCase", "PascalCase"] },
85
+ { selector: "typeLike", format: ["PascalCase"] },
86
+ {
87
+ selector: "variable",
88
+ types: ["boolean"],
89
+ format: ["PascalCase"],
90
+ prefix: ["is", "should", "has", "can", "did", "will", "are"],
91
+ leadingUnderscore: "allow",
92
+ },
93
+ ],
94
+ "@typescript-eslint/consistent-type-definitions": [ERROR, "type"],
95
+ "@typescript-eslint/non-nullable-type-assertion-style": OFF,
96
+ "@typescript-eslint/no-unused-vars": [
97
+ ERROR,
98
+ {
99
+ args: "all",
100
+ argsIgnorePattern: "^_",
101
+ caughtErrors: "all",
102
+ caughtErrorsIgnorePattern: "^_",
103
+ destructuredArrayIgnorePattern: "^_",
104
+ varsIgnorePattern: "^_",
105
+ ignoreRestSiblings: true,
106
+ },
107
+ ],
108
+ },
109
+ },
110
+ {
111
+ files: ["*.cjs"],
112
+ languageOptions: {
113
+ sourceType: "commonjs",
114
+ },
115
+ },
116
+ {
117
+ files: ["*.mjs"],
118
+ languageOptions: {
119
+ sourceType: "module",
120
+ },
121
+ },
122
+ {
123
+ files: ["**/*.test.*"],
124
+ rules: {
125
+ "@typescript-eslint/no-unused-vars": [OFF],
126
+ },
127
+ },
128
+ {
129
+ files: ["**/*.jsx", "**/*.tsx"],
130
+ extends: [
131
+ reactPlugin.configs.flat.recommended,
132
+ reactPlugin.configs.flat["jsx-runtime"],
133
+ reactHooksPlugin.configs.flat["recommended-latest"],
134
+ ],
135
+ settings: {
136
+ react: {
137
+ version: "detect",
138
+ },
139
+ },
140
+ rules: {
141
+ "react-hooks/exhaustive-deps": [
142
+ WARN,
143
+ {
144
+ additionalHooks: "(useSelect|useSuspenseSelect)",
145
+ },
146
+ ],
147
+ },
148
+ },
149
+ ]);
150
+
151
+ export const playwrightConfig = defineConfig([
152
+ {
153
+ extends: [playwrightConfigs["flat/recommended"]],
154
+ rules: {
155
+ "playwright/expect-expect": [
156
+ ERROR,
157
+ {
158
+ assertFunctionNames: [
159
+ "playAudit", // This is the lighthouse playwright test, which contains threshold assertions.
160
+ ],
161
+ },
162
+ ],
163
+ },
164
+ },
165
+ ]);
package/package.json CHANGED
@@ -1,23 +1,30 @@
1
1
  {
2
2
  "name": "@atomicsmash/coding-standards",
3
3
  "type": "module",
4
- "version": "17.0.2",
4
+ "version": "18.0.0-beta.2",
5
5
  "description": "A collection of coding standards configurations.",
6
6
  "main": "index.js",
7
7
  "types": "index.d.ts",
8
8
  "devDependencies": {
9
- "@cspell/cspell-types": "^9.6.0"
9
+ "@cspell/cspell-types": "^9.7.0"
10
10
  },
11
11
  "peerDependencies": {
12
- "@atomicsmash/browserslist-config": "^17.0.2",
13
- "@atomicsmash/eslint-config": "^17.0.2",
14
- "@wordpress/stylelint-config": "^23.30.0",
15
- "prettier": "^3.8.0",
12
+ "@atomicsmash/browserslist-config": "^18.0.0-beta.2",
13
+ "@atomicsmash/eslint-config": "^18.0.0-beta.2",
14
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
15
+ "@eslint/js": "^8.57.1",
16
+ "@wordpress/stylelint-config": "^23.33.0",
17
+ "eslint": "^8.57.1",
18
+ "eslint-config-prettier": "^8.10.2",
19
+ "eslint-plugin-import": "^2.32.0",
20
+ "globals": "^13.24.0",
21
+ "prettier": "^3.8.1",
16
22
  "stylelint": "^16.26.1",
17
23
  "stylelint-config-standard": "^39.0.1",
18
24
  "stylelint-config-standard-scss": "^16.0.0",
19
25
  "stylelint-no-restricted-syntax": "^2.2.1",
20
- "stylelint-order": "^7.0.1"
26
+ "stylelint-order": "^7.0.1",
27
+ "typescript-eslint": "^8.50.0"
21
28
  },
22
29
  "keywords": [
23
30
  "atomic",