Skip to content

Commit

Permalink
add typescript, add changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
temoncher committed Jan 16, 2023
1 parent c610dc4 commit d3b4c51
Show file tree
Hide file tree
Showing 25 changed files with 2,667 additions and 257 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/heavy-tips-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'eslint-plugin-clsx': patch
---

switched the project to typescript
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
22 changes: 20 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'script',
sourceType: 'module',
},
extends: ['airbnb-base', 'plugin:prettier/recommended'],
reportUnusedDisableDirectives: true,
rules: {
'global-require': 0,
'no-continue': 0,
'no-unused-vars': [1, { argsIgnorePattern: '^_.*' }],
'no-case-declarations': 2,
'prefer-destructuring': 1,
'no-param-reassign': 2,
Expand Down Expand Up @@ -72,4 +72,22 @@ module.exports = {
},
],
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
extends: [
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',
'airbnb-typescript/base',
'plugin:import/typescript',
'plugin:prettier/recommended',
],
parserOptions: {
project: './tsconfig.json',
},
rules: {
'@typescript-eslint/no-unused-vars': [1, { argsIgnorePattern: '^_.*' }],
},
},
],
};
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI
on:
push:
branches:
- "**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: .npm

- run: npm ci
- run: npm run lint
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish
on:
push:
branches:
- "main"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: .npm

- run: npm ci
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: npm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
.vscode
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ const singleClasses = cn('single-class');
const singleClasses = mc('single-class');
```

Default setting value is `{ clsx: 'default', classnames: 'default' }`
Default setting value is `{ clsx: ['default', 'clsx'], classnames: 'default' }`
3 changes: 1 addition & 2 deletions docs/rules/forbid-true-inside-object-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Examples of **incorrect** code for this rule:
/* eslint clsx/forbid-true-inside-object-expressions: error */

const trueClasses = clsx({ 'true-class-1': true, 'true-class-2': true });
const falseClasses = clsx({ 'dynamic-condition-class': condition, 'false-class': false });
```

Examples of **correct** code for this rule:
Expand All @@ -25,7 +24,7 @@ Examples of **correct** code for this rule:
/* eslint clsx/forbid-true-inside-object-expressions: error */

const trueClasses = clsx('true-class-1', 'true-class-2');
const falseClasses = clsx({ 'dynamic-condition-class': condition });
const dynamicClasses = clsx({ 'dynamic-condition-class': condition });
```

## Options
Expand Down
39 changes: 0 additions & 39 deletions lib/index.js

This file was deleted.

98 changes: 0 additions & 98 deletions lib/utils.js

This file was deleted.

Loading

0 comments on commit d3b4c51

Please sign in to comment.