@atomicsmash/coding-standards 18.0.0-beta.6 → 18.0.0-beta.7

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cspell/index.d.ts +15 -0
  3. package/dist/cspell/index.d.ts.map +1 -0
  4. package/dist/cspell/index.js +133 -0
  5. package/dist/eslint/index.d.ts +4 -0
  6. package/dist/eslint/index.d.ts.map +1 -0
  7. package/dist/eslint/index.js +198 -0
  8. package/dist/index.d.ts +5 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +4 -0
  11. package/dist/prettier/index.d.ts +13 -0
  12. package/dist/prettier/index.d.ts.map +1 -0
  13. package/dist/prettier/index.js +32 -0
  14. package/dist/stylelint/base.d.ts +69 -0
  15. package/dist/stylelint/base.d.ts.map +1 -0
  16. package/dist/stylelint/base.js +86 -0
  17. package/dist/stylelint/classic.d.ts +69 -0
  18. package/dist/stylelint/classic.d.ts.map +1 -0
  19. package/dist/stylelint/classic.js +2 -0
  20. package/dist/stylelint/index.d.ts +161 -0
  21. package/dist/stylelint/index.d.ts.map +1 -0
  22. package/dist/stylelint/index.js +4 -0
  23. package/dist/stylelint/tailwind.d.ts +21 -0
  24. package/dist/stylelint/tailwind.d.ts.map +1 -0
  25. package/dist/stylelint/tailwind.js +38 -0
  26. package/dist/stylelint/theme-json.d.ts +73 -0
  27. package/dist/stylelint/theme-json.d.ts.map +1 -0
  28. package/dist/stylelint/theme-json.js +169 -0
  29. package/package.json +49 -12
  30. package/typescript/base.json +2 -1
  31. package/typescript/cypress.json +1 -1
  32. package/.eslintrc.cjs +0 -8
  33. package/beta/README.md +0 -3
  34. package/beta/eslint/index.js +0 -200
  35. package/cspell/index.cjs +0 -142
  36. package/cspell/index.js +0 -1
  37. package/cspell/index.mjs +0 -142
  38. package/index.d.ts +0 -7
  39. package/index.js +0 -5
  40. package/index.mjs +0 -4
  41. package/prettier/index.cjs +0 -35
  42. package/prettier/index.js +0 -1
  43. package/prettier/index.mjs +0 -35
  44. package/stylelint/base.cjs +0 -91
  45. package/stylelint/base.js +0 -1
  46. package/stylelint/base.mjs +0 -91
  47. package/stylelint/classic.cjs +0 -3
  48. package/stylelint/classic.js +0 -1
  49. package/stylelint/classic.mjs +0 -2
  50. package/stylelint/index.cjs +0 -5
  51. package/stylelint/index.mjs +0 -4
  52. package/stylelint/tailwind.cjs +0 -38
  53. package/stylelint/tailwind.js +0 -1
  54. package/stylelint/tailwind.mjs +0 -38
  55. package/stylelint/theme-json.cjs +0 -189
  56. package/stylelint/theme-json.js +0 -1
  57. package/stylelint/theme-json.mjs +0 -189
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atomicsmash/coding-standards
2
2
 
3
+ ## 18.0.0-beta.7
4
+
5
+ ### Major Changes
6
+
7
+ - [#548](https://github.com/AtomicSmash/packages/pull/548) [`3cbb8b8`](https://github.com/AtomicSmash/packages/commit/3cbb8b8b7b1e588a30786cae9f4675ebcf143492) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Remove AS ESLint config package as an automatic peer dependency to avoid conflicts with new config
8
+
9
+ - [#548](https://github.com/AtomicSmash/packages/pull/548) [`3cbb8b8`](https://github.com/AtomicSmash/packages/commit/3cbb8b8b7b1e588a30786cae9f4675ebcf143492) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Convert configs to typescript and use proper exports setup
10
+
11
+ ### Patch Changes
12
+
13
+ - [#548](https://github.com/AtomicSmash/packages/pull/548) [`3cbb8b8`](https://github.com/AtomicSmash/packages/commit/3cbb8b8b7b1e588a30786cae9f4675ebcf143492) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Update deps
14
+
15
+ - Updated dependencies []:
16
+ - @atomicsmash/browserslist-config@18.0.0-beta.7
17
+
3
18
  ## 18.0.0-beta.6
4
19
 
5
20
  ### Patch Changes
@@ -0,0 +1,15 @@
1
+ declare const config: {
2
+ language: string;
3
+ words: string[];
4
+ languageSettings: ({
5
+ languageId: string;
6
+ locale: string;
7
+ dictionaries?: undefined;
8
+ } | {
9
+ languageId: string;
10
+ locale: string;
11
+ dictionaries: string[];
12
+ })[];
13
+ };
14
+ export default config;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cspell/index.ts"],"names":[],"mappings":"AA+FA,QAAA,MAAM,MAAM;;;;;;;;;;;;CA0DkB,CAAC;AAC/B,eAAe,MAAM,CAAC"}
@@ -0,0 +1,133 @@
1
+ import { existsSync, readFileSync } from "fs";
2
+ import { resolve, dirname, join } from "path";
3
+ /**
4
+ * Search for `package.json`
5
+ */
6
+ function findNearestPackageJson(from) {
7
+ from = resolve(from);
8
+ const parent = dirname(from);
9
+ if (!from || parent === from) {
10
+ return;
11
+ }
12
+ const pkg = join(from, "package.json");
13
+ if (existsSync(pkg)) {
14
+ return pkg;
15
+ }
16
+ return findNearestPackageJson(parent);
17
+ }
18
+ /**
19
+ * Load the nearest package.json
20
+ */
21
+ function loadPackageJson(cwd) {
22
+ const pkgFile = findNearestPackageJson(cwd);
23
+ if (!pkgFile)
24
+ return null;
25
+ const packageJson = JSON.parse(readFileSync(pkgFile, "utf-8"));
26
+ if (typeof packageJson === "object" && packageJson !== null) {
27
+ return packageJson;
28
+ }
29
+ return null;
30
+ }
31
+ function determinePackageNamesAndMethods(cwd = process.cwd()) {
32
+ const packageImport = loadPackageJson(cwd) ?? {};
33
+ const packageNames = Object.keys(("dependencies" in packageImport && packageImport.dependencies) ?? {}).concat(Object.keys(("devDependencies" in packageImport && packageImport.devDependencies) ??
34
+ {}));
35
+ return { packageNames };
36
+ }
37
+ /**
38
+ * Search for `composer.json`
39
+ */
40
+ function findNearestComposerJson(from) {
41
+ from = resolve(from);
42
+ const parent = dirname(from);
43
+ if (!from || parent === from) {
44
+ return;
45
+ }
46
+ const composerJsonPath = join(from, "composer.json");
47
+ if (existsSync(composerJsonPath)) {
48
+ return composerJsonPath;
49
+ }
50
+ return findNearestComposerJson(parent);
51
+ }
52
+ /**
53
+ * Load the nearest composer.json
54
+ */
55
+ function loadComposer(cwd) {
56
+ const composerJsonFile = findNearestComposerJson(cwd);
57
+ if (!composerJsonFile)
58
+ return;
59
+ const composerJson = JSON.parse(readFileSync(composerJsonFile, "utf-8"));
60
+ if (typeof composerJson === "object" && composerJson !== null) {
61
+ return composerJson;
62
+ }
63
+ return null;
64
+ }
65
+ function determineComposerPackageNamesAndMethods(cwd = process.cwd()) {
66
+ const packageImport = loadComposer(cwd) ?? {};
67
+ const packageNames = Object.keys(("require" in packageImport && packageImport.require) ?? {})
68
+ .concat(Object.keys(("require-dev" in packageImport && packageImport["require-dev"]) ?? {}))
69
+ .reduce((allowedWords, packageName) => {
70
+ return [...allowedWords, ...packageName.split("/")];
71
+ }, []);
72
+ return { packageNames };
73
+ }
74
+ const config = {
75
+ language: "en-GB",
76
+ words: [
77
+ ...[
78
+ ...determinePackageNamesAndMethods().packageNames,
79
+ ...determineComposerPackageNamesAndMethods().packageNames,
80
+ "commitlint",
81
+ "sass",
82
+ "Userback",
83
+ "phpcs",
84
+ "phpcbf",
85
+ ], // package and language names
86
+ ...["tsbuildinfo", "svgs"], // filenames
87
+ ...["combobox", "spinbutton"], // accessible roles
88
+ ...["popover", "dialog"], // custom element names
89
+ ...["atomicsmash"], // company all lowercase
90
+ ...["unstringified", "formattable", "keyof", "nonnullable", "hidable"], // coding actions
91
+ ...[
92
+ "alignfull",
93
+ "alignleft",
94
+ "alignright",
95
+ "muplugin",
96
+ "textdomain",
97
+ "color", // For in theme.json
98
+ "gfield", // Gravity Forms field class
99
+ "phpmailer",
100
+ "WPMDB", // WP Migrate DB
101
+ "shortcode",
102
+ "wp_kses",
103
+ "sprintf", // For @wordpress/i18n
104
+ ], // WordPress stuff
105
+ ],
106
+ languageSettings: [
107
+ {
108
+ languageId: "*",
109
+ locale: "en-GB",
110
+ },
111
+ {
112
+ languageId: "css, less, scss, sass",
113
+ locale: "en-US",
114
+ dictionaries: ["css"],
115
+ },
116
+ {
117
+ languageId: "javascript,typescript,javascriptreact,typescriptreact",
118
+ locale: "en-GB",
119
+ dictionaries: ["typescript"],
120
+ },
121
+ {
122
+ languageId: "php",
123
+ locale: "en-GB",
124
+ dictionaries: ["php", "html"],
125
+ },
126
+ {
127
+ languageId: "html,vue-html,javascriptreact,typescriptreact",
128
+ locale: "en-GB",
129
+ dictionaries: ["html"],
130
+ },
131
+ ],
132
+ };
133
+ export default config;
@@ -0,0 +1,4 @@
1
+ import type { Config } from "@eslint/config-helpers";
2
+ export declare const playwrightConfig: Config[];
3
+ export declare const recommendedConfig: Config[];
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eslint/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,MAAM,EAAE,MAAM,wBAAwB,CAAC;AA2LrE,eAAO,MAAM,gBAAgB,UAe3B,CAAC;AAEH,eAAO,MAAM,iBAAiB,UAK5B,CAAC"}
@@ -0,0 +1,198 @@
1
+ const OFF = 0;
2
+ const WARN = 1;
3
+ const ERROR = 2;
4
+ import { defineConfig } from "@eslint/config-helpers";
5
+ import js from "@eslint/js";
6
+ import esLintComments from "@eslint-community/eslint-plugin-eslint-comments/configs";
7
+ import importPlugin from "eslint-plugin-import";
8
+ import { default as playwrightPlugin } from "eslint-plugin-playwright";
9
+ import reactPlugin from "eslint-plugin-react";
10
+ import reactHooksPlugin from "eslint-plugin-react-hooks";
11
+ import globals from "globals";
12
+ import tseslint from "typescript-eslint";
13
+ const baseConfig = defineConfig({
14
+ name: "@atomicsmash/coding-standards/base-config",
15
+ files: ["**/*.js", "**/*.cjs", "**/*.mjs"],
16
+ extends: [
17
+ js.configs.recommended,
18
+ esLintComments.recommended,
19
+ importPlugin.flatConfigs.recommended,
20
+ ],
21
+ languageOptions: {
22
+ ecmaVersion: 2022,
23
+ sourceType: "module",
24
+ globals: {
25
+ ...globals.browser,
26
+ ...globals.node,
27
+ },
28
+ },
29
+ rules: {
30
+ "no-case-declarations": [OFF],
31
+ "import/order": [
32
+ ERROR,
33
+ {
34
+ alphabetize: {
35
+ order: "asc",
36
+ },
37
+ groups: [
38
+ "type",
39
+ "builtin",
40
+ "external",
41
+ "internal",
42
+ "parent",
43
+ ["sibling", "index"],
44
+ ],
45
+ "newlines-between": "ignore",
46
+ pathGroups: [],
47
+ pathGroupsExcludedImportTypes: [],
48
+ },
49
+ ],
50
+ "prefer-const": [ERROR],
51
+ "no-var": [ERROR],
52
+ "import/no-duplicates": WARN,
53
+ "@eslint-community/eslint-comments/no-unused-disable": [ERROR],
54
+ "@eslint-community/eslint-comments/require-description": [
55
+ ERROR,
56
+ { ignore: ["eslint-enable"] },
57
+ ],
58
+ },
59
+ settings: {
60
+ "import/resolver": {
61
+ node: true,
62
+ },
63
+ },
64
+ });
65
+ const typescriptConfig = defineConfig([
66
+ {
67
+ name: "@atomicsmash/coding-standards/typescript-config",
68
+ files: ["**/*.ts", "**/*.cts", "**/*.mts"],
69
+ extends: [
70
+ baseConfig,
71
+ tseslint.configs.strictTypeChecked,
72
+ tseslint.configs.stylisticTypeChecked,
73
+ importPlugin.flatConfigs.typescript,
74
+ ],
75
+ plugins: {
76
+ "@typescript-eslint": tseslint.plugin,
77
+ },
78
+ languageOptions: {
79
+ parser: tseslint.parser,
80
+ parserOptions: {
81
+ projectService: true,
82
+ },
83
+ },
84
+ rules: {
85
+ "@typescript-eslint/naming-convention": [
86
+ ERROR,
87
+ {
88
+ selector: "variableLike",
89
+ format: ["camelCase", "PascalCase", "UPPER_CASE"],
90
+ leadingUnderscore: "allow",
91
+ },
92
+ { selector: "function", format: ["camelCase", "PascalCase"] },
93
+ { selector: "typeLike", format: ["PascalCase"] },
94
+ {
95
+ selector: "variable",
96
+ types: ["boolean"],
97
+ format: ["PascalCase"],
98
+ prefix: ["is", "should", "has", "can", "did", "will", "are"],
99
+ leadingUnderscore: "allow",
100
+ },
101
+ ],
102
+ "@typescript-eslint/consistent-type-definitions": [ERROR, "type"],
103
+ "@typescript-eslint/non-nullable-type-assertion-style": OFF,
104
+ "@typescript-eslint/no-unused-vars": [
105
+ ERROR,
106
+ {
107
+ args: "all",
108
+ argsIgnorePattern: "^_",
109
+ caughtErrors: "all",
110
+ caughtErrorsIgnorePattern: "^_",
111
+ destructuredArrayIgnorePattern: "^_",
112
+ varsIgnorePattern: "^_",
113
+ ignoreRestSiblings: true,
114
+ },
115
+ ],
116
+ },
117
+ settings: {
118
+ "import/resolver": {
119
+ typescript: true,
120
+ node: true,
121
+ },
122
+ },
123
+ },
124
+ ]);
125
+ if (reactPlugin.configs.flat.recommended === undefined ||
126
+ reactPlugin.configs.flat["jsx-runtime"] === undefined) {
127
+ // Throw is needed to fix types correctly
128
+ // This should never happen so if it does, it's an error worthy of breaking all eslint configs.
129
+ throw new Error("Failed to get config from eslint-plugin-react.");
130
+ }
131
+ const sharedReactRulesAndSettings = {
132
+ extends: [
133
+ reactPlugin.configs.flat.recommended,
134
+ reactPlugin.configs.flat["jsx-runtime"],
135
+ reactHooksPlugin.configs.flat.recommended,
136
+ ],
137
+ settings: {
138
+ react: {
139
+ version: "detect",
140
+ },
141
+ },
142
+ rules: {
143
+ "react-hooks/exhaustive-deps": [
144
+ WARN,
145
+ {
146
+ additionalHooks: "(useSelect|useSuspenseSelect)",
147
+ },
148
+ ],
149
+ },
150
+ };
151
+ const reactConfig = defineConfig([
152
+ {
153
+ name: "@atomicsmash/coding-standards/react-config",
154
+ files: ["**/*.jsx"],
155
+ extends: [baseConfig, ...sharedReactRulesAndSettings.extends],
156
+ settings: {
157
+ ...sharedReactRulesAndSettings.settings,
158
+ },
159
+ rules: {
160
+ ...sharedReactRulesAndSettings.rules,
161
+ },
162
+ },
163
+ ]);
164
+ const reactTypescriptConfig = defineConfig([
165
+ {
166
+ name: "@atomicsmash/coding-standards/react-typescript-config",
167
+ files: ["**/*.tsx"],
168
+ extends: [typescriptConfig, ...sharedReactRulesAndSettings.extends],
169
+ settings: {
170
+ ...sharedReactRulesAndSettings.settings,
171
+ },
172
+ rules: {
173
+ ...sharedReactRulesAndSettings.rules,
174
+ },
175
+ },
176
+ ]);
177
+ export const playwrightConfig = defineConfig([
178
+ {
179
+ name: "@atomicsmash/coding-standards/playwright-config",
180
+ extends: [playwrightPlugin.configs["flat/recommended"]],
181
+ rules: {
182
+ "playwright/expect-expect": [
183
+ ERROR,
184
+ {
185
+ assertFunctionNames: [
186
+ "playAudit", // This is the lighthouse playwright test, which contains threshold assertions.
187
+ ],
188
+ },
189
+ ],
190
+ },
191
+ },
192
+ ]);
193
+ export const recommendedConfig = defineConfig([
194
+ baseConfig,
195
+ typescriptConfig,
196
+ reactConfig,
197
+ reactTypescriptConfig,
198
+ ]);
@@ -0,0 +1,5 @@
1
+ import { default as cspellConfig } from "./cspell/index.js";
2
+ import { default as prettierConfig } from "./prettier/index.js";
3
+ import { default as stylelintConfig } from "./stylelint/index.js";
4
+ export { cspellConfig, prettierConfig, stylelintConfig };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import { default as cspellConfig } from "./cspell/index.js";
2
+ import { default as prettierConfig } from "./prettier/index.js";
3
+ import { default as stylelintConfig } from "./stylelint/index.js";
4
+ export { cspellConfig, prettierConfig, stylelintConfig };
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ useTabs: true;
3
+ trailingComma: "all";
4
+ overrides: {
5
+ files: string[];
6
+ options: {
7
+ useTabs: false;
8
+ tabWidth: number;
9
+ };
10
+ }[];
11
+ };
12
+ export default _default;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prettier/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,wBAkCmB"}
@@ -0,0 +1,32 @@
1
+ export default {
2
+ /* Expected defaults:
3
+ Prettier recommendation
4
+ printWidth: 80,
5
+
6
+ Single quotes are more often found in text strings (used for apostrophes) so using double quotes prevents lots of escaping characters.
7
+ singleQuote: false,
8
+
9
+ Keep very nested indentation near the left to prevent lots of horizontal scrolling.
10
+ tabWidth: 2,
11
+
12
+ Semicolons prevent AST errors and are more explicit where a line ends
13
+ semi: true,
14
+
15
+ Consistent line endings for MacOS and Windows
16
+ endOfLine: "lf",
17
+ */
18
+ // Tabs are better for visually impaired coders https://www.reddit.com/r/javascript/comments/c8drjo/nobody_talks_about_the_real_reason_to_use_tabs/
19
+ useTabs: true,
20
+ // Helps clean up git diffs by removing changes of a single comma on a line if adding a new line to the bottom
21
+ trailingComma: "all",
22
+ overrides: [
23
+ {
24
+ // yml files require specific indentation rules
25
+ files: ["*.yml", "*.yaml"],
26
+ options: {
27
+ useTabs: false,
28
+ tabWidth: 2,
29
+ },
30
+ },
31
+ ],
32
+ };
@@ -0,0 +1,69 @@
1
+ declare const _default: {
2
+ reportDescriptionlessDisables: true;
3
+ reportInvalidScopeDisables: true;
4
+ reportNeedlessDisables: true;
5
+ plugins: string[];
6
+ rules: {
7
+ "custom-property-pattern": null;
8
+ "function-url-quotes": string[];
9
+ "rule-empty-line-before": (string | {
10
+ except: string[];
11
+ ignore: string[];
12
+ })[];
13
+ "comment-empty-line-before": (string | {
14
+ except: string[];
15
+ ignore: string[];
16
+ })[];
17
+ "order/order": (string | {
18
+ type: string;
19
+ hasBlock: boolean;
20
+ })[];
21
+ "plugin/no-restricted-syntax": {
22
+ selector: string;
23
+ message: string;
24
+ }[][];
25
+ "selector-class-pattern": (string | {
26
+ message: string;
27
+ })[];
28
+ "at-rule-empty-line-before": (string | {
29
+ ignore: string[];
30
+ })[];
31
+ };
32
+ overrides: ({
33
+ files: string[];
34
+ extends: string[];
35
+ rules: {
36
+ "at-rule-no-unknown": (boolean | {
37
+ ignoreAtRules: string;
38
+ })[];
39
+ "scss/operator-no-newline-after"?: undefined;
40
+ "no-descending-specificity"?: undefined;
41
+ "scss/at-rule-no-unknown"?: undefined;
42
+ "declaration-property-value-allowed-list"?: undefined;
43
+ };
44
+ } | {
45
+ files: string[];
46
+ extends: string[];
47
+ rules: {
48
+ "scss/operator-no-newline-after": null;
49
+ "no-descending-specificity": null;
50
+ "scss/at-rule-no-unknown": (boolean | {
51
+ ignoreAtRules: string;
52
+ })[];
53
+ "at-rule-no-unknown"?: undefined;
54
+ "declaration-property-value-allowed-list"?: undefined;
55
+ };
56
+ } | {
57
+ files: string[];
58
+ rules: {
59
+ "declaration-property-value-allowed-list": null;
60
+ "at-rule-no-unknown"?: undefined;
61
+ "scss/operator-no-newline-after"?: undefined;
62
+ "no-descending-specificity"?: undefined;
63
+ "scss/at-rule-no-unknown"?: undefined;
64
+ };
65
+ extends?: undefined;
66
+ })[];
67
+ };
68
+ export default _default;
69
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/stylelint/base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,wBAiCmB"}
@@ -0,0 +1,86 @@
1
+ const commonRules = {
2
+ "custom-property-pattern": null,
3
+ "function-url-quotes": ["always"],
4
+ "rule-empty-line-before": [
5
+ "always",
6
+ {
7
+ except: ["first-nested"],
8
+ ignore: ["after-comment"],
9
+ },
10
+ ],
11
+ "comment-empty-line-before": [
12
+ "always",
13
+ {
14
+ except: ["first-nested"],
15
+ ignore: ["stylelint-commands"],
16
+ },
17
+ ],
18
+ "order/order": [
19
+ {
20
+ type: "at-rule",
21
+ hasBlock: false,
22
+ },
23
+ "custom-properties",
24
+ "dollar-variables",
25
+ "declarations",
26
+ {
27
+ type: "at-rule",
28
+ hasBlock: true,
29
+ },
30
+ "rules",
31
+ ],
32
+ "plugin/no-restricted-syntax": [
33
+ [
34
+ {
35
+ selector: "rule :matches(atrule[name=media], atrule[name=container]) rule",
36
+ message: "Don't nest rules inside of media/container blocks. Instead, nest the rule and use the at rule within that.",
37
+ },
38
+ ],
39
+ ],
40
+ "selector-class-pattern": [
41
+ "^([a-z][a-z0-9]*)([_-]+[a-z0-9]+)*$",
42
+ {
43
+ message: "Selector should use lowercase and separate words with hyphens or underscores (selector-class-pattern)",
44
+ },
45
+ ],
46
+ "at-rule-empty-line-before": [
47
+ "always",
48
+ {
49
+ ignore: ["blockless-after-blockless", "first-nested", "after-comment"],
50
+ },
51
+ ],
52
+ };
53
+ export default {
54
+ reportDescriptionlessDisables: true,
55
+ reportInvalidScopeDisables: true,
56
+ reportNeedlessDisables: true,
57
+ plugins: ["stylelint-order", "stylelint-no-restricted-syntax"],
58
+ rules: commonRules,
59
+ overrides: [
60
+ {
61
+ files: ["*.css", "**/*.css"],
62
+ extends: ["stylelint-config-standard", "@wordpress/stylelint-config"],
63
+ rules: {
64
+ "at-rule-no-unknown": [true, { ignoreAtRules: "context" }],
65
+ },
66
+ },
67
+ {
68
+ files: ["*.scss", "**/*.scss"],
69
+ extends: [
70
+ "stylelint-config-standard-scss",
71
+ "@wordpress/stylelint-config/scss",
72
+ ],
73
+ rules: {
74
+ "scss/operator-no-newline-after": null,
75
+ "no-descending-specificity": null,
76
+ "scss/at-rule-no-unknown": [true, { ignoreAtRules: "context" }],
77
+ },
78
+ },
79
+ {
80
+ files: ["**/editor-style?(s).?(s)css"],
81
+ rules: {
82
+ "declaration-property-value-allowed-list": null,
83
+ },
84
+ },
85
+ ],
86
+ };
@@ -0,0 +1,69 @@
1
+ declare const _default: {
2
+ reportDescriptionlessDisables: true;
3
+ reportInvalidScopeDisables: true;
4
+ reportNeedlessDisables: true;
5
+ plugins: string[];
6
+ rules: {
7
+ "custom-property-pattern": null;
8
+ "function-url-quotes": string[];
9
+ "rule-empty-line-before": (string | {
10
+ except: string[];
11
+ ignore: string[];
12
+ })[];
13
+ "comment-empty-line-before": (string | {
14
+ except: string[];
15
+ ignore: string[];
16
+ })[];
17
+ "order/order": (string | {
18
+ type: string;
19
+ hasBlock: boolean;
20
+ })[];
21
+ "plugin/no-restricted-syntax": {
22
+ selector: string;
23
+ message: string;
24
+ }[][];
25
+ "selector-class-pattern": (string | {
26
+ message: string;
27
+ })[];
28
+ "at-rule-empty-line-before": (string | {
29
+ ignore: string[];
30
+ })[];
31
+ };
32
+ overrides: ({
33
+ files: string[];
34
+ extends: string[];
35
+ rules: {
36
+ "at-rule-no-unknown": (boolean | {
37
+ ignoreAtRules: string;
38
+ })[];
39
+ "scss/operator-no-newline-after"?: undefined;
40
+ "no-descending-specificity"?: undefined;
41
+ "scss/at-rule-no-unknown"?: undefined;
42
+ "declaration-property-value-allowed-list"?: undefined;
43
+ };
44
+ } | {
45
+ files: string[];
46
+ extends: string[];
47
+ rules: {
48
+ "scss/operator-no-newline-after": null;
49
+ "no-descending-specificity": null;
50
+ "scss/at-rule-no-unknown": (boolean | {
51
+ ignoreAtRules: string;
52
+ })[];
53
+ "at-rule-no-unknown"?: undefined;
54
+ "declaration-property-value-allowed-list"?: undefined;
55
+ };
56
+ } | {
57
+ files: string[];
58
+ rules: {
59
+ "declaration-property-value-allowed-list": null;
60
+ "at-rule-no-unknown"?: undefined;
61
+ "scss/operator-no-newline-after"?: undefined;
62
+ "no-descending-specificity"?: undefined;
63
+ "scss/at-rule-no-unknown"?: undefined;
64
+ };
65
+ extends?: undefined;
66
+ })[];
67
+ };
68
+ export default _default;
69
+ //# sourceMappingURL=classic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classic.d.ts","sourceRoot":"","sources":["../../src/stylelint/classic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBAAuC"}