Skip to content

Commit

Permalink
Artur/des 583 fix lint errors (#18)
Browse files Browse the repository at this point in the history
Co-authored-by: baked <tristancilltseinleben@gmail.com>
  • Loading branch information
arturbien and baked-dev authored Nov 21, 2023
1 parent 6c30663 commit 920a218
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 1,287 deletions.
3 changes: 3 additions & 0 deletions apps/playground/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
root: true,
extends: ['custom'],
globals: {
module: 'readonly',
},
};
3 changes: 2 additions & 1 deletion apps/playground/css.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// My css.d.ts file
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type * as CSS from 'csstype';

declare module 'csstype' {
Expand All @@ -12,7 +13,7 @@ declare module 'csstype' {
// [index: `--theme-${string}`]: any;

// Allow any CSS Custom Properties
[index: `--${string}`]: any;
[index: `--${string}`]: unknown;

// ...or allow any other property
// [index: string]: any;
Expand Down
2 changes: 1 addition & 1 deletion apps/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@radix-ui/react-icons": "^1.3.0",
"frosted-ui": "*",
"frosted-ui": "workspace*",
"next": "^13.4.1",
"next-themes": "^0.2.1",
"react": "^18.2.0",
Expand Down
3 changes: 3 additions & 0 deletions apps/tailwind/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
root: true,
extends: ['custom'],
globals: {
module: 'readonly',
},
};
3 changes: 2 additions & 1 deletion apps/tailwind/css.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// My css.d.ts file
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type * as CSS from 'csstype';

declare module 'csstype' {
Expand All @@ -12,7 +13,7 @@ declare module 'csstype' {
// [index: `--theme-${string}`]: any;

// Allow any CSS Custom Properties
[index: `--${string}`]: any;
[index: `--${string}`]: unknown;

// ...or allow any other property
// [index: string]: any;
Expand Down
2 changes: 1 addition & 1 deletion apps/tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@radix-ui/react-icons": "^1.3.0",
"frosted-ui": "*",
"frosted-ui": "workspace*",
"next": "^13.4.1",
"next-themes": "^0.2.1",
"react": "^18.2.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/frosted-ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ module.exports = {
rules: {
'@typescript-eslint/no-empty-interface': 'off',
},
globals: {
module: 'readonly',
},
};
18 changes: 18 additions & 0 deletions packages/frosted-ui/.unimportedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"preset": "node",
"entry": ["src/index.ts"],
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"flow": false,
"ignorePatterns": [
"**/node_modules/**",
"**/*.tests.{js,jsx,ts,tsx}",
"**/*.test.{js,jsx,ts,tsx}",
"**/*.spec.{js,jsx,ts,tsx}",
"**/tests/**",
"**/__tests__/**",
"**/*.d.ts"
],
"ignoreUnimported": [],
"ignoreUnused": ["@radix-ui/colors", "tslib"],
"ignoreUnresolved": ["react"]
}
1 change: 0 additions & 1 deletion packages/frosted-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-direction": "^1.0.1",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-form": "^0.0.3",
"@radix-ui/react-hover-card": "^1.0.7",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-portal": "^1.0.4",
Expand Down
7 changes: 5 additions & 2 deletions packages/frosted-ui/postcss-radix-themes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-undef */
const fs = require('fs');
const path = require('path');
const postcss = require('postcss');
Expand All @@ -9,6 +11,7 @@ const breakpoints = postcss
.parse(breakpointsCss)
.nodes.map((node) => {
if (node.type === 'atrule' && node.name === 'custom-media') {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_match, name, params] = node.params.match(/--(\w+)\s+(.+)/);
return { name, params };
}
Expand Down Expand Up @@ -94,14 +97,14 @@ function addPrefix(node, prefix) {
* Should not match:
* .rt-Button
*/
const classNameRegexp = /\.(-?rt-r-[a-z0-9\-]+)/g;
const classNameRegexp = /\.(-?rt-r-[a-z0-9-]+)/g;

// Check for rules that use compound props on a component:
// - a component name (prefixed with "rt-" and pascal cased)
// - followed by 2 or more prop selectors (lowercase, numbers, -)
//
// e.g. ".rt-DialogContent.rt-r-size-2.gray"
if (/\.rt-(?:[A-Z][a-z]+)+(?:\.[a-z0-9\-]+){2,}/.test(node.selector)) {
if (/\.rt-(?:[A-Z][a-z]+)+(?:\.[a-z0-9-]+){2,}/.test(node.selector)) {
throw Error(`
"${node.selector}" looks like it uses compound props on a component.
"@breakpoints" does not support compound props yet.
Expand Down
2 changes: 2 additions & 0 deletions packages/frosted-ui/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-undef */
const path = require('path');

module.exports = {
Expand Down
1 change: 1 addition & 0 deletions packages/frosted-ui/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export * from './progress.props';
export { RadioGroup, RadioGroupItem, RadioGroupRoot } from './radio-group';
export * from './radio-group.props';
// export * from './radio-card-group';
export { Shine } from './lab/shine';
export {
Select,
SelectContent,
Expand Down
Loading

0 comments on commit 920a218

Please # to comment.