ultracite 3.2.4 → 3.3.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/SECURITY.md DELETED
@@ -1,9 +0,0 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
-
5
- Currently, only the latest on `main` branch is supported with security updates.
6
-
7
- ## Reporting a Vulnerability
8
-
9
- To report a vulnerability, open a new issue or DM me on [Twitter / X](https://twitter.com/haydenbleasel).
package/eslint.config.mjs DELETED
@@ -1,173 +0,0 @@
1
- /* eslint-disable n/no-extraneous-import, import/no-extraneous-dependencies, id-length */
2
-
3
- import react from 'eslint-plugin-react';
4
- import reactHooks from 'eslint-plugin-react-hooks';
5
- import typescript from '@typescript-eslint/eslint-plugin';
6
- import jsxA11y from 'eslint-plugin-jsx-a11y';
7
- import * as importPlugin from 'eslint-plugin-import';
8
- import jest from 'eslint-plugin-jest';
9
- import promise from 'eslint-plugin-promise';
10
- import n from 'eslint-plugin-n';
11
- import next from '@next/eslint-plugin-next';
12
- import globals from 'globals';
13
- import prettier from 'eslint-plugin-prettier';
14
- import cypress from 'eslint-plugin-cypress';
15
- import storybook from 'eslint-plugin-storybook';
16
- import unusedImports from 'eslint-plugin-unused-imports';
17
- // import tailwindcss from 'eslint-plugin-tailwindcss';
18
- import * as importTypescriptResolver from 'eslint-import-resolver-typescript';
19
-
20
- import eslintPrettier from 'eslint-config-prettier';
21
- import * as typescriptParser from '@typescript-eslint/parser';
22
-
23
- import eslintRules from './rules/eslint.mjs';
24
- import reactRules from './rules/react.mjs';
25
- import reactHooksRules from './rules/reactHooks.mjs';
26
- import typescriptRules from './rules/typescript.mjs';
27
- import jsxA11yRules from './rules/jsx-a11y.mjs';
28
- import importRules from './rules/import.mjs';
29
- import jestRules from './rules/jest.mjs';
30
- import promiseRules from './rules/promise.mjs';
31
- import nRules from './rules/n.mjs';
32
- import nextRules from './rules/next.mjs';
33
- import prettierRules from './rules/prettier.mjs';
34
- import eslintTypescriptRules from './rules/eslint-typescript.mjs';
35
- import cypressRules from './rules/cypress.mjs';
36
- import storybookRules from './rules/storybook.mjs';
37
- // import tailwindcssRules from './rules/tailwindcss.mjs';
38
- import unusedImportsRules from './rules/unused-imports.mjs';
39
-
40
- // Patch AudioWorkletGlobalScope
41
- const browserGlobals = { ...globals.browser };
42
- delete browserGlobals['AudioWorkletGlobalScope '];
43
-
44
- const config = [
45
- importPlugin.configs.typescript,
46
- {
47
- languageOptions: {
48
- sourceType: 'module',
49
- globals: {
50
- ...browserGlobals,
51
- ...globals.node,
52
- },
53
- parserOptions: {
54
- ecmaVersion: 'latest',
55
- sourceType: 'module',
56
- ecmaFeatures: {
57
- jsx: true,
58
- },
59
- },
60
- },
61
- files: [
62
- '**/*.js',
63
- '**/*.jsx',
64
- '**/*.ts',
65
- '**/*.tsx',
66
- '**/*.json',
67
- '**/*.mjs',
68
- '**/*.cjs',
69
- ],
70
- plugins: {
71
- prettier,
72
- react,
73
- 'react-hooks': reactHooks,
74
- 'jsx-a11y': jsxA11y,
75
- import: importPlugin,
76
- promise,
77
- n,
78
- '@next/next': next,
79
- 'unused-imports': unusedImports,
80
- // tailwindcss,
81
- },
82
- rules: {
83
- ...eslintRules,
84
- ...reactRules,
85
- ...reactHooksRules,
86
- ...jsxA11yRules,
87
- ...importRules,
88
- ...promiseRules,
89
- ...nRules,
90
- ...nextRules,
91
- ...prettierRules,
92
- ...eslintPrettier.rules,
93
- ...unusedImportsRules,
94
- // ...tailwindcssRules,
95
- },
96
-
97
- settings: {
98
- react: {
99
- version: 'detect',
100
- },
101
-
102
- // https://github.com/import-js/eslint-plugin-import/issues/2556#issuecomment-1419518561
103
- 'import/parsers': {
104
- espree: ['.js', '.cjs', '.mjs', '.jsx', '.ts', '.tsx'],
105
- },
106
- 'import/resolver': {
107
- typescript: true,
108
- node: true,
109
- },
110
- },
111
- },
112
- {
113
- files: ['**/*.ts', '**/*.tsx'],
114
- languageOptions: {
115
- parser: typescriptParser,
116
- parserOptions: {
117
- project: './tsconfig.json',
118
- },
119
- },
120
- plugins: {
121
- '@typescript-eslint': typescript,
122
- 'import/typescript': importTypescriptResolver,
123
- },
124
- rules: {
125
- ...eslintTypescriptRules,
126
- ...typescriptRules,
127
- },
128
- },
129
- {
130
- files: ['**/*.test.js', '**/*.test.jsx', 'tests/**/*.js', 'tests/**/*.jsx'],
131
- languageOptions: {
132
- globals: {
133
- ...globals.jest,
134
- },
135
- },
136
- plugins: {
137
- jest,
138
- },
139
- rules: {
140
- ...jestRules,
141
- },
142
- },
143
- {
144
- files: ['**/*.cy.js', '**/*.cy.jsx'],
145
- languageOptions: {
146
- globals: {
147
- ...globals.cypress,
148
- },
149
- },
150
- plugins: {
151
- cypress,
152
- },
153
- rules: {
154
- ...cypressRules,
155
- },
156
- },
157
- {
158
- files: [
159
- '**/*.stories.js',
160
- '**/*.stories.jsx',
161
- '**/*.stories.ts',
162
- '**/*.stories.tsx',
163
- ],
164
- plugins: {
165
- storybook,
166
- },
167
- rules: {
168
- ...storybookRules,
169
- },
170
- },
171
- ];
172
-
173
- export default config;
package/prettier.js DELETED
@@ -1,13 +0,0 @@
1
- /* eslint-disable import/no-commonjs, import/unambiguous */
2
-
3
- module.exports = {
4
- tabWidth: 2,
5
- useTabs: false,
6
- semi: true,
7
- singleQuote: true,
8
- trailingComma: 'es5',
9
- bracketSpacing: true,
10
- arrowParens: 'always',
11
- proseWrap: 'never',
12
- printWidth: 80,
13
- };
package/rules/cypress.mjs DELETED
@@ -1,17 +0,0 @@
1
- import plugin from 'eslint-plugin-cypress';
2
-
3
- const { rules } = plugin;
4
-
5
- const availableKeys = Object.keys(rules).filter(
6
- (key) => !rules[key].meta.deprecated
7
- );
8
-
9
- const baseRules = Object.fromEntries(
10
- availableKeys.map((key) => [`cypress/${key}`, 'error'])
11
- );
12
-
13
- const overrideRules = {};
14
-
15
- const config = Object.assign(baseRules, overrideRules);
16
-
17
- export default config;
@@ -1,43 +0,0 @@
1
- const config = {
2
- // ESLint Disabled for Typescript-ESLint
3
- 'brace-style': 'off',
4
- camelcase: 'off',
5
- 'comma-dangle': 'off',
6
- 'comma-spacing': 'off',
7
- 'default-param-last': 'off',
8
- 'dot-notation': 'off',
9
- 'func-call-spacing': 'off',
10
- indent: 'off',
11
- 'init-declarations': 'off',
12
- 'keyword-spacing': 'off',
13
- 'lines-between-class-members': 'off',
14
- 'no-array-constructor': 'off',
15
- 'no-dupe-class-members': 'off',
16
- 'no-duplicate-imports': 'off',
17
- 'no-empty-function': 'off',
18
- 'no-extra-parens': 'off',
19
- 'no-extra-semi': 'off',
20
- 'no-implied-eval': 'off',
21
- 'no-invalid-this': 'off',
22
- 'no-loop-func': 'off',
23
- 'no-loss-of-precision': 'off',
24
- 'no-magic-numbers': 'off',
25
- 'no-redeclare': 'off',
26
- 'no-restricted-imports': 'off',
27
- 'no-shadow': 'off',
28
- 'no-throw-literal': 'off',
29
- 'no-unused-expressions': 'off',
30
- 'no-unused-vars': 'off',
31
- 'no-use-before-define': 'off',
32
- 'no-useless-constructor': 'off',
33
- 'object-curly-spacing': 'off',
34
- 'padding-line-between-statements': 'off',
35
- quotes: 'off',
36
- 'require-await': 'off',
37
- 'no-return-await': 'off',
38
- semi: 'off',
39
- 'space-before-function-paren': 'off',
40
- 'space-infix-ops': 'off',
41
- };
42
-
43
- export default config;
package/rules/eslint.mjs DELETED
@@ -1,189 +0,0 @@
1
- const config = {
2
- // ESLint Possible Problems: These rules relate to possible logic errors in code
3
- 'array-callback-return': 'error',
4
- 'constructor-super': 'error',
5
- 'for-direction': 'error',
6
- 'getter-return': 'error',
7
- 'no-async-promise-executor': 'error',
8
- 'no-await-in-loop': 'error',
9
- 'no-class-assign': 'error',
10
- 'no-compare-neg-zero': 'error',
11
- 'no-cond-assign': 'error',
12
- 'no-const-assign': 'error',
13
- 'no-constant-condition': 'error',
14
- 'no-constructor-return': 'error',
15
- 'no-control-regex': 'error',
16
- 'no-debugger': 'error',
17
- 'no-dupe-args': 'error',
18
- 'no-dupe-else-if': 'error',
19
- 'no-dupe-keys': 'error',
20
- 'no-duplicate-case': 'error',
21
- 'no-empty-character-class': 'error',
22
- 'no-empty-pattern': 'error',
23
- 'no-ex-assign': 'error',
24
- 'no-fallthrough': 'error',
25
- 'no-func-assign': 'error',
26
- 'no-import-assign': 'error',
27
- 'no-inner-declarations': 'error',
28
- 'no-invalid-regexp': 'error',
29
- 'no-irregular-whitespace': 'error',
30
- 'no-misleading-character-class': 'error',
31
- 'no-new-symbol': 'error',
32
- 'no-obj-calls': 'error',
33
- 'no-promise-executor-return': 'error',
34
- 'no-prototype-builtins': 'error',
35
- 'no-self-assign': 'error',
36
- 'no-self-compare': 'error',
37
- 'no-setter-return': 'error',
38
- 'no-sparse-arrays': 'error',
39
- 'no-template-curly-in-string': 'error',
40
- 'no-this-before-super': 'error',
41
- 'no-undef': 'error',
42
- 'no-unmodified-loop-condition': 'error',
43
- 'no-unreachable': 'error',
44
- 'no-unreachable-loop': 'error',
45
- 'no-unsafe-finally': 'error',
46
- 'no-unsafe-negation': 'error',
47
- 'no-unsafe-optional-chaining': 'error',
48
- 'no-unused-private-class-members': 'off',
49
- 'no-useless-backreference': 'error',
50
- 'require-atomic-updates': 'error',
51
- 'use-isnan': 'error',
52
- 'valid-typeof': 'error',
53
-
54
- // ESLint Suggestions: These rules suggest alternate ways of doing things
55
- 'accessor-pairs': 'error',
56
- 'arrow-body-style': 'error',
57
- 'block-scoped-var': 'error',
58
- 'capitalized-comments': 'off',
59
- 'class-methods-use-this': 'error',
60
- complexity: 'off',
61
- 'consistent-return': 'error',
62
- 'consistent-this': 'error',
63
- curly: 'error',
64
- 'default-case': 'error',
65
- 'default-case-last': 'error',
66
- eqeqeq: 'error',
67
- 'func-name-matching': 'error',
68
- 'func-names': 'error',
69
- 'func-style': 'error',
70
- 'grouped-accessor-pairs': 'error',
71
- 'guard-for-in': 'error',
72
- 'id-denylist': 'error',
73
- 'id-length': ['error', { exceptions: ['x', 'y', 'z'] }],
74
- 'id-match': 'error',
75
- 'max-classes-per-file': 'error',
76
- 'max-depth': 'error',
77
- 'max-lines': 'off',
78
- 'max-lines-per-function': 'off',
79
- 'max-nested-callbacks': 'error',
80
- 'max-params': 'off',
81
- 'max-statements': 'off',
82
- 'multiline-comment-style': 'error',
83
- 'new-cap': 'error',
84
- 'no-alert': 'error',
85
- 'no-bitwise': 'error',
86
- 'no-caller': 'error',
87
- 'no-case-declarations': 'error',
88
- 'no-console': 'error',
89
- 'no-continue': 'error',
90
- 'no-delete-var': 'error',
91
- 'no-div-regex': 'error',
92
- 'no-else-return': 'error',
93
- 'no-empty': 'error',
94
- 'no-eq-null': 'error',
95
- 'no-eval': 'error',
96
- 'no-extend-native': 'error',
97
- 'no-extra-bind': 'error',
98
- 'no-extra-boolean-cast': 'error',
99
- 'no-extra-label': 'error',
100
- 'no-global-assign': 'error',
101
- 'no-implicit-coercion': 'error',
102
- 'no-implicit-globals': 'error',
103
- 'no-inline-comments': 'error',
104
- 'no-iterator': 'error',
105
- 'no-label-var': 'error',
106
- 'no-labels': 'error',
107
- 'no-lone-blocks': 'error',
108
- 'no-lonely-if': 'error',
109
- 'no-multi-assign': 'error',
110
- 'no-multi-str': 'error',
111
- 'no-negated-condition': 'error',
112
- 'no-nested-ternary': 'error',
113
- 'no-new': 'error',
114
- 'no-new-func': 'error',
115
- 'no-new-object': 'error',
116
- 'no-new-wrappers': 'error',
117
- 'no-nonoctal-decimal-escape': 'error',
118
- 'no-octal': 'error',
119
- 'no-octal-escape': 'error',
120
- 'no-param-reassign': 'error',
121
- 'no-plusplus': 'error',
122
- 'no-proto': 'error',
123
- 'no-regex-spaces': 'error',
124
- 'no-restricted-exports': 'error',
125
- 'no-restricted-globals': 'error',
126
- 'no-restricted-properties': 'error',
127
- 'no-restricted-syntax': 'error',
128
- 'no-return-assign': 'error',
129
- 'no-script-url': 'error',
130
- 'no-sequences': 'error',
131
- 'no-shadow-restricted-names': 'error',
132
- 'no-ternary': 'off',
133
- 'no-undef-init': 'error',
134
- 'no-undefined': 'off',
135
- 'no-underscore-dangle': 'error',
136
- 'no-unneeded-ternary': 'error',
137
- 'no-unused-labels': 'error',
138
- 'no-useless-call': 'error',
139
- 'no-useless-catch': 'error',
140
- 'no-useless-computed-key': 'error',
141
- 'no-useless-concat': 'error',
142
- 'no-useless-escape': 'error',
143
- 'no-useless-rename': 'error',
144
- 'no-useless-return': 'error',
145
- 'no-var': 'error',
146
- 'no-void': 'error',
147
- 'no-warning-comments': 'error',
148
- 'no-with': 'error',
149
- 'object-shorthand': 'error',
150
- 'one-var': 'off',
151
- 'operator-assignment': 'error',
152
- 'prefer-arrow-callback': 'error',
153
- 'prefer-const': 'error',
154
- 'prefer-destructuring': [
155
- 'error',
156
- {
157
- array: false,
158
- object: true,
159
- },
160
- ],
161
- 'prefer-exponentiation-operator': 'error',
162
- 'prefer-named-capture-group': 'error',
163
- 'prefer-numeric-literals': 'error',
164
- 'prefer-object-spread': 'error',
165
- 'prefer-promise-reject-errors': 'error',
166
- 'prefer-regex-literals': 'error',
167
- 'prefer-rest-params': 'error',
168
- 'prefer-spread': 'error',
169
- 'prefer-template': 'error',
170
- radix: 'error',
171
- 'require-unicode-regexp': 'error',
172
- 'require-yield': 'error',
173
-
174
- // https://github.com/eslint/eslint/issues/11542
175
- 'sort-imports': 'off',
176
-
177
- 'sort-keys': 'off',
178
- 'sort-vars': 'off',
179
- 'spaced-comment': 'error',
180
- strict: 'error',
181
- 'symbol-description': 'error',
182
- 'vars-on-top': 'error',
183
- yoda: 'error',
184
-
185
- // ESLint Layout & Formatting: These rules care about how the code looks rather than how it executes
186
- 'line-comment-position': 'error',
187
- };
188
-
189
- export default config;
package/rules/import.mjs DELETED
@@ -1,44 +0,0 @@
1
- import { rules } from 'eslint-plugin-import';
2
-
3
- const availableKeys = Object.keys(rules).filter(
4
- (key) => !rules[key].meta.deprecated
5
- );
6
-
7
- const baseRules = Object.fromEntries(
8
- availableKeys.map((key) => [`import/${key}`, 'error'])
9
- );
10
-
11
- const overrideRules = {
12
- 'import/no-unresolved': 'off',
13
- 'import/no-internal-modules': 'off',
14
- 'import/no-relative-parent-imports': 'off',
15
- 'import/no-named-as-default': 'off',
16
- 'import/exports-last': 'off',
17
- 'import/no-namespace': 'off',
18
- 'import/extensions': 'off',
19
- 'import/order': [
20
- 'error',
21
- {
22
- groups: [
23
- 'builtin',
24
- 'external',
25
- 'internal',
26
- 'parent',
27
- 'sibling',
28
- 'index',
29
- 'object',
30
- 'type',
31
- ],
32
- },
33
- ],
34
- 'import/prefer-default-export': 'off',
35
- 'import/max-dependencies': 'off',
36
- 'import/no-unassigned-import': 'off',
37
- 'import/no-default-export': 'off',
38
- 'import/no-named-export': 'off',
39
- 'import/group-exports': 'off',
40
- };
41
-
42
- const config = Object.assign(baseRules, overrideRules);
43
-
44
- export default config;
package/rules/jest.mjs DELETED
@@ -1,17 +0,0 @@
1
- import plugin from 'eslint-plugin-jest';
2
-
3
- const { rules } = plugin;
4
-
5
- const availableKeys = Object.keys(rules).filter(
6
- (key) => !rules[key].meta.deprecated
7
- );
8
-
9
- const baseRules = Object.fromEntries(
10
- availableKeys.map((key) => [`jest/${key}`, 'error'])
11
- );
12
-
13
- const overrideRules = {};
14
-
15
- const config = Object.assign(baseRules, overrideRules);
16
-
17
- export default config;
@@ -1,27 +0,0 @@
1
- import plugin from 'eslint-plugin-jsx-a11y';
2
-
3
- const { rules } = plugin;
4
-
5
- const availableKeys = Object.keys(rules).filter(
6
- (key) => !rules[key].meta.deprecated
7
- );
8
-
9
- const baseRules = Object.fromEntries(
10
- availableKeys.map((key) => [`jsx-a11y/${key}`, 'error'])
11
- );
12
-
13
- const overrideRules = {
14
- 'jsx-a11y/no-autofocus': 'off',
15
- 'jsx-a11y/label-has-associated-control': [
16
- 'error',
17
- {
18
- labelComponents: ['Label'],
19
- controlComponents: ['Input', 'Select', 'Textarea', 'Checkbox', 'Radio'],
20
- depth: 3,
21
- },
22
- ],
23
- };
24
-
25
- const config = Object.assign(baseRules, overrideRules);
26
-
27
- export default config;
package/rules/n.mjs DELETED
@@ -1,24 +0,0 @@
1
- import plugin from 'eslint-plugin-n';
2
-
3
- const { rules } = plugin;
4
-
5
- const availableKeys = Object.keys(rules).filter(
6
- (key) => !rules[key].meta.deprecated
7
- );
8
-
9
- const baseRules = Object.fromEntries(
10
- availableKeys.map((key) => [`n/${key}`, 'error'])
11
- );
12
-
13
- const overrideRules = {
14
- 'n/no-missing-import': 'off',
15
- 'n/no-unsupported-features/es-builtins': 'off',
16
- 'n/no-unsupported-features/es-syntax': 'off',
17
- 'n/no-unsupported-features/node-builtins': 'off',
18
- 'n/file-extension-in-import': 'off',
19
- 'n/no-process-env': 'off',
20
- };
21
-
22
- const config = Object.assign(baseRules, overrideRules);
23
-
24
- export default config;
package/rules/next.mjs DELETED
@@ -1,17 +0,0 @@
1
- import plugin from '@next/eslint-plugin-next';
2
-
3
- const { rules } = plugin;
4
-
5
- const availableKeys = Object.keys(rules).filter(
6
- (key) => !rules[key].meta.deprecated
7
- );
8
-
9
- const baseRules = Object.fromEntries(
10
- availableKeys.map((key) => [`@next/next/${key}`, 'error'])
11
- );
12
-
13
- const overrideRules = {};
14
-
15
- const config = Object.assign(baseRules, overrideRules);
16
-
17
- export default config;
@@ -1,5 +0,0 @@
1
- const config = {
2
- 'prettier/prettier': 'error',
3
- };
4
-
5
- export default config;
package/rules/promise.mjs DELETED
@@ -1,20 +0,0 @@
1
- import plugin from 'eslint-plugin-promise';
2
-
3
- const { rules } = plugin;
4
-
5
- const availableKeys = Object.keys(rules).filter(
6
- (key) => !rules[key].meta.deprecated
7
- );
8
-
9
- const baseRules = Object.fromEntries(
10
- availableKeys.map((key) => [`promise/${key}`, 'error'])
11
- );
12
-
13
- const overrideRules = {
14
- 'promise/catch-or-return': ['error', { allowFinally: true }],
15
- 'promise/no-native': 'off',
16
- };
17
-
18
- const config = Object.assign(baseRules, overrideRules);
19
-
20
- export default config;
package/rules/react.mjs DELETED
@@ -1,46 +0,0 @@
1
- import plugin from 'eslint-plugin-react';
2
-
3
- const { rules } = plugin;
4
-
5
- const availableKeys = Object.keys(rules).filter(
6
- (key) => !rules[key].meta.deprecated
7
- );
8
-
9
- const baseRules = Object.fromEntries(
10
- availableKeys.map((key) => [`react/${key}`, 'error'])
11
- );
12
-
13
- const overrideRules = {
14
- 'react/forbid-component-props': 'off',
15
- 'react/function-component-definition': [
16
- 'error',
17
- {
18
- namedComponents: 'arrow-function',
19
- },
20
- ],
21
- 'react/no-array-index-key': 'off',
22
- 'react/no-arrow-function-lifecycle': 'off',
23
- 'react/no-invalid-html-attribute': 'off',
24
- 'react/no-multi-comp': 'off',
25
- 'react/no-unused-class-component-methods': 'off',
26
- 'react/react-in-jsx-scope': 'off',
27
- 'react/require-default-props': 'off',
28
- 'react/jsx-filename-extension': [
29
- 'error',
30
- {
31
- extensions: ['.tsx'],
32
- },
33
- ],
34
- 'react/jsx-max-depth': 'off',
35
- 'react/jsx-max-props-per-line': 'off',
36
- 'react/jsx-newline': 'off',
37
- 'react/jsx-no-bind': 'off',
38
- 'react/jsx-no-literals': 'off',
39
- 'react/jsx-one-expression-per-line': 'off',
40
- 'react/jsx-props-no-spreading': 'off',
41
- 'react/jsx-sort-props': 'off',
42
- };
43
-
44
- const config = Object.assign(baseRules, overrideRules);
45
-
46
- export default config;
@@ -1,23 +0,0 @@
1
- import { rules } from 'eslint-plugin-react-hooks';
2
-
3
- const availableKeys = Object.keys(rules).filter(
4
- (key) => !rules[key].meta.deprecated
5
- );
6
-
7
- const baseRules = Object.fromEntries(
8
- availableKeys.map((key) => [`react-hooks/${key}`, 'error'])
9
- );
10
-
11
- const overrideRules = {
12
- 'react-hooks/exhaustive-deps': [
13
- 'error',
14
- {
15
- // Add support for useAsync by react-use
16
- additionalHooks: '(useAsync)',
17
- },
18
- ],
19
- };
20
-
21
- const config = Object.assign(baseRules, overrideRules);
22
-
23
- export default config;