@atomicsmash/coding-standards 16.0.1 → 17.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/.eslintrc.cjs CHANGED
@@ -1,4 +1,8 @@
1
+ /** @type {import('eslint').Linter.Config} */
1
2
  module.exports = {
2
3
  extends: ["@atomicsmash/eslint-config"],
4
+ parserOptions: {
5
+ sourceType: "module",
6
+ },
3
7
  ignorePatterns: ["**/*.d.ts"],
4
8
  };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @atomicsmash/coding-standards
2
2
 
3
+ ## 17.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#472](https://github.com/AtomicSmash/packages/pull/472) [`3f656e0`](https://github.com/AtomicSmash/packages/commit/3f656e02f88f88bbdc2b538b1cb23a959479bf99) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Remove PHPCS config
8
+
9
+ - [#472](https://github.com/AtomicSmash/packages/pull/472) [`521823e`](https://github.com/AtomicSmash/packages/commit/521823e0a6100f8d46ce2c86e8491101ed8beffc) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Migrate to ESM first imports
10
+
11
+ - [#472](https://github.com/AtomicSmash/packages/pull/472) [`7f3f4cc`](https://github.com/AtomicSmash/packages/commit/7f3f4cc582492c8b83bf889747a5d91eb1f01983) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Remove commitlint
12
+
13
+ ### Patch Changes
14
+
15
+ - [#488](https://github.com/AtomicSmash/packages/pull/488) [`52c94f9`](https://github.com/AtomicSmash/packages/commit/52c94f9941bc54e835d429c882482473dfaef6e0) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Update deps
16
+
17
+ - Updated dependencies [[`52c94f9`](https://github.com/AtomicSmash/packages/commit/52c94f9941bc54e835d429c882482473dfaef6e0)]:
18
+ - @atomicsmash/browserslist-config@17.0.0
19
+ - @atomicsmash/eslint-config@17.0.0
20
+
21
+ ## 17.0.0-beta.0
22
+
23
+ ### Major Changes
24
+
25
+ - [#472](https://github.com/AtomicSmash/packages/pull/472) [`3f656e0`](https://github.com/AtomicSmash/packages/commit/3f656e02f88f88bbdc2b538b1cb23a959479bf99) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Remove PHPCS config
26
+
27
+ - [#472](https://github.com/AtomicSmash/packages/pull/472) [`521823e`](https://github.com/AtomicSmash/packages/commit/521823e0a6100f8d46ce2c86e8491101ed8beffc) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Migrate to ESM first imports
28
+
29
+ - [#472](https://github.com/AtomicSmash/packages/pull/472) [`7f3f4cc`](https://github.com/AtomicSmash/packages/commit/7f3f4cc582492c8b83bf889747a5d91eb1f01983) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Remove commitlint
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies []:
34
+ - @atomicsmash/eslint-config@17.0.0-beta.0
35
+ - @atomicsmash/browserslist-config@17.0.0-beta.0
36
+
3
37
  ## 16.0.1
4
38
 
5
39
  ### Patch Changes
package/MIGRATING.md CHANGED
@@ -2,6 +2,94 @@
2
2
 
3
3
  This document contains information on how to migrate from one version to the next version.
4
4
 
5
+ ## v16 --> v17
6
+
7
+ ### Removal of commitlint.
8
+
9
+ We no longer use commitlint after moving to changesets. If your project still uses the commitlint config, you should remove it from the project and uninstall all commitlint dependencies.
10
+
11
+ ### Removal of PHPCS config.
12
+
13
+ We migrated the PHPCS config to a composer package in v13 of this package, this config was only kept around for legacy projects, but it's now been removed.
14
+
15
+ To install the new package, use the following instructions:
16
+
17
+ 1. Install the new package
18
+
19
+ ```sh
20
+ composer require --dev atomicsmash/php-coding-standards
21
+ ```
22
+
23
+ 2. Update the existing `phpcs.xml` file to the new package location
24
+
25
+ ```xml
26
+ <rule ref="./vendor/atomicsmash/php-coding-standards/phpcs.xml"/>
27
+ ```
28
+
29
+ ### Migration of coding standards configs to ESM - Part 1
30
+
31
+ In v13 we added ESM versions of our config scripts with the goal of migrating to modern ESM. This is being done to assist with updating ESLint which is now EOL for the version we're stuck on.
32
+
33
+ We are now making the next step which is to migrate the plain .js files to point to the new ESM files instead of the old config files. At this point, the old configs are still kept around in case of issues, however it's highly recommended to migrate your configs to the new ESM imports instead.
34
+
35
+ In a future version, the old CJS files WILL be removed, so if you don't migrate now, you will have to do it later.
36
+
37
+ Here's some specific examples for the tools you need to update:
38
+
39
+ #### CSpell
40
+
41
+ No change needed if using .js extension. If using .mjs or .cjs, migrate to using the .js extension. If you're using the .mjs extension you'll use the right file, but it will still break as the .mjs files will be removed in the future as well to avoid clutter.
42
+
43
+ ```js
44
+ {
45
+ "import": ["@atomicsmash/coding-standards/cspell/index.js"]
46
+ }
47
+ ```
48
+
49
+ #### Prettier
50
+
51
+ You likely have a `prettier.config.cjs` file which looks like this:
52
+
53
+ ```js
54
+ module.exports = {
55
+ ...require("@atomicsmash/coding-standards").prettierConfig,
56
+ };
57
+ ```
58
+
59
+ Rename the file to `prettier.config.mjs` and use this instead:
60
+
61
+ ```js
62
+ import { prettierConfig } from "@atomicsmash/coding-standards";
63
+ export default prettierConfig;
64
+ ```
65
+
66
+ #### Stylelint
67
+
68
+ You likely have a `.stylelintrc.cjs` file which looks like this:
69
+
70
+ ```js
71
+ const stylelintConfig = require("@atomicsmash/coding-standards/stylelint/classic");
72
+
73
+ /** @type {import('stylelint').Config} */
74
+ module.exports = stylelintConfig;
75
+ ```
76
+
77
+ OR
78
+
79
+ ```js
80
+ module.exports = {
81
+ extends: ["@atomicsmash/coding-standards/stylelint/classic"],
82
+ };
83
+ ```
84
+
85
+ Rename the file to `.stylelintrc.mjs` and use this instead:
86
+
87
+ ```js
88
+ export default {
89
+ extends: ["@atomicsmash/coding-standards/stylelint/classic"],
90
+ };
91
+ ```
92
+
5
93
  ## v15 --> v16
6
94
 
7
95
  Browserslist query has been updated to exclude Chrome versions older than 120.
package/cspell/index.js CHANGED
@@ -1 +1 @@
1
- module.exports = require("./index.cjs");
1
+ export { default } from "./index.mjs";
package/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
- export const commitlintConfig: import("@commitlint/types").UserConfig;
2
1
  export const cspellConfig: import("@cspell/cspell-types").CSpellUserSettings;
3
2
  export const prettierConfig: import("prettier").Config;
3
+ export const stylelintConfig: {
4
+ classic: import("stylelint").Config;
5
+ themeJson: import("stylelint").Config;
6
+ tailwind: import("stylelint").Config;
7
+ };
package/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  module.exports = {
2
- commitlintConfig: require("./commitlint"),
3
2
  cspellConfig: require("./cspell/index.cjs"),
4
3
  prettierConfig: require("./prettier/index.cjs"),
5
4
  stylelintConfig: require("./stylelint/index.cjs"),
package/package.json CHANGED
@@ -1,24 +1,23 @@
1
1
  {
2
2
  "name": "@atomicsmash/coding-standards",
3
- "version": "16.0.1",
3
+ "type": "module",
4
+ "version": "17.0.0",
4
5
  "description": "A collection of coding standards configurations.",
5
6
  "main": "index.js",
6
7
  "types": "index.d.ts",
7
8
  "devDependencies": {
8
- "@cspell/cspell-types": "^8.19.4"
9
+ "@cspell/cspell-types": "^9.5.0"
9
10
  },
10
11
  "peerDependencies": {
11
- "@atomicsmash/browserslist-config": "^16.0.1",
12
- "@atomicsmash/eslint-config": "^16.0.1",
13
- "@commitlint/cli": "^19.8.1",
14
- "@commitlint/config-conventional": "^19.8.1",
15
- "@wordpress/stylelint-config": "^23.27.0",
16
- "prettier": "^3.6.2",
17
- "stylelint": "^16.25.0",
18
- "stylelint-config-standard": "^36.0.1",
19
- "stylelint-config-standard-scss": "^14.0.0",
12
+ "@atomicsmash/browserslist-config": "^17.0.0",
13
+ "@atomicsmash/eslint-config": "^17.0.0",
14
+ "@wordpress/stylelint-config": "^23.28.0",
15
+ "prettier": "^3.7.4",
16
+ "stylelint": "^16.26.1",
17
+ "stylelint-config-standard": "^39.0.1",
18
+ "stylelint-config-standard-scss": "^16.0.0",
20
19
  "stylelint-no-restricted-syntax": "^2.2.1",
21
- "stylelint-order": "^6.0.4"
20
+ "stylelint-order": "^7.0.0"
22
21
  },
23
22
  "keywords": [
24
23
  "atomic",
package/prettier/index.js CHANGED
@@ -1 +1 @@
1
- module.exports = require("./index.cjs");
1
+ export { default } from "./index.mjs";
package/stylelint/base.js CHANGED
@@ -1 +1 @@
1
- module.exports = require("./base.cjs");
1
+ export { default } from "./base.mjs";
@@ -1 +1 @@
1
- module.exports = require("./classic.cjs");
1
+ export { default } from "./classic.mjs";
@@ -1,4 +1,4 @@
1
1
  import { default as classic } from "./classic.mjs";
2
- import { default as themeJson } from "./theme-json.mjs";
3
2
  import { default as tailwind } from "./tailwind.mjs";
3
+ import { default as themeJson } from "./theme-json.mjs";
4
4
  export default { classic, themeJson, tailwind };
@@ -1 +1 @@
1
- module.exports = require("./tailwind.cjs");
1
+ export { default } from "./tailwind.mjs";
@@ -1 +1 @@
1
- module.exports = require("./theme-json.cjs");
1
+ export { default } from "./theme-json.mjs";
@@ -1 +0,0 @@
1
- module.exports = { extends: ["@commitlint/config-conventional"] };
package/phpcs/phpcs.xml DELETED
@@ -1,56 +0,0 @@
1
- <?xml version="1.0"?>
2
- <ruleset name="Atomic Smash's Rules">
3
- <exclude-pattern>*/node_modules/*</exclude-pattern>
4
- <exclude-pattern>*/vendor/*</exclude-pattern>
5
- <arg name="extensions" value="php" />
6
- <arg value="sp"/>
7
- <arg name="parallel" value="20"/>
8
- <arg name="cache"/>
9
- <arg name="report" value="summary"/>
10
- <ini name="memory_limit" value="256M"/>
11
- <rule ref="WordPress">
12
- <exclude name="Generic.Formatting.MultipleStatementAlignment"/>
13
- <exclude name="WordPress.Arrays.MultipleStatementAlignment"/>
14
- <exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/>
15
- <exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound"/>
16
- <exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
17
- </rule>
18
- <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
19
- <rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
20
- <rule ref="WordPress.Files.FileName">
21
- <properties>
22
- <property name="is_theme" value="true"/>
23
- </properties>
24
- </rule>
25
- <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
26
- <properties>
27
- <property name="ignoreBlankLines" value="true"/>
28
- </properties>
29
- </rule>
30
- <rule ref="Generic.Files.LineEndings">
31
- <properties>
32
- <property name="eolChar" value="\n"/>
33
- </properties>
34
- </rule>
35
- <config name="testVersion" value="8.2-"/>
36
- <rule ref="PHPCompatibilityWP">
37
- <include-pattern>*\.php$</include-pattern>
38
- </rule>
39
- <rule ref="VariableAnalysis"/>
40
- <rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
41
- <exclude-pattern>*/lib/*</exclude-pattern>
42
- <exclude-pattern>*/classes/*</exclude-pattern>
43
- </rule>
44
- <rule ref="WordPress.Files.FileName.InvalidClassFileName">
45
- <exclude-pattern>*/lib/*</exclude-pattern>
46
- <exclude-pattern>*/classes/*</exclude-pattern>
47
- </rule>
48
- <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint"/>
49
- <rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"/>
50
- <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"/>
51
- <rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
52
- <rule ref="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint"/>
53
- <rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
54
- <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
55
- <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
56
- </ruleset>