Skip to content

Commit

Permalink
Add .editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
AsPulse committed Dec 12, 2023
1 parent 14ee95f commit 30597f2
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 23 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
indent_style = space
indent_size = 2
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This configuration only applies to the package manager root.
/** @type {import("eslint").Linter.Config} */
module.exports = {
ignorePatterns: ["apps/**", "packages/**"],
extends: ["@repo/eslint-config/library.js"],
parser: "@typescript-eslint/parser",
ignorePatterns: ['configs/**', 'packages/**', 'tests/**'],
extends: ['@repo/eslint-config/library.js'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
},
Expand Down
3 changes: 3 additions & 0 deletions .prettierrc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
trailingComma = "es5"
semi = true
singleQuote = true
18 changes: 9 additions & 9 deletions configs/eslint-config/library.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const { resolve } = require("node:path");
const { resolve } = require('node:path');

const project = resolve(process.cwd(), "tsconfig.json");
const project = resolve(process.cwd(), 'tsconfig.json');

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
plugins: ["only-warn"],
extends: ['eslint:recommended', 'prettier', 'eslint-config-turbo'],
plugins: ['only-warn'],
globals: {
React: true,
JSX: true,
Expand All @@ -14,21 +14,21 @@ module.exports = {
node: true,
},
settings: {
"import/resolver": {
'import/resolver': {
typescript: {
project,
},
},
},
ignorePatterns: [
// Ignore dotfiles
".*.js",
"node_modules/",
"dist/",
'.*.js',
'node_modules/',
'dist/',
],
overrides: [
{
files: ["*.js?(x)", "*.ts?(x)"],
files: ['*.js?(x)', '*.ts?(x)'],
},
],
};
18 changes: 9 additions & 9 deletions configs/eslint-config/react-internal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { resolve } = require("node:path");
const { resolve } = require('node:path');

const project = resolve(process.cwd(), "tsconfig.json");
const project = resolve(process.cwd(), 'tsconfig.json');

/*
* This is a custom ESLint configuration for use with
Expand All @@ -14,8 +14,8 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
plugins: ["only-warn"],
extends: ['eslint:recommended', 'prettier', 'eslint-config-turbo'],
plugins: ['only-warn'],
globals: {
React: true,
JSX: true,
Expand All @@ -24,20 +24,20 @@ module.exports = {
browser: true,
},
settings: {
"import/resolver": {
'import/resolver': {
typescript: {
project,
},
},
},
ignorePatterns: [
// Ignore dotfiles
".*.js",
"node_modules/",
"dist/",
'.*.js',
'node_modules/',
'dist/',
],
overrides: [
// Force ESLint to detect .tsx files
{ files: ["*.js?(x)", "*.ts?(x)"] },
{ files: ['*.js?(x)', '*.ts?(x)'] },
],
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"scripts": {
"build": "turbo build",
"lint": "turbo lint -- --max-warnings=0",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"format:check": "prettier --check \"**/*.{ts,tsx,md}\""
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,md,json}\"",
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,md,json}\""
},
"devDependencies": {
"@manypkg/cli": "^0.21.1",
Expand Down
9 changes: 9 additions & 0 deletions packages/core/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ['@repo/eslint-config/react-internal.js'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.lint.json',
},
};
65 changes: 65 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "@sugarform/core",
"version": "0.1.0",
"description": "Sugarform is Uncontrolled, Growth-ready, And Reusable form framework of react.",
"repository": {
"type": "git",
"url": "git+https://github.com/sugarform-dev/sugarform.git"
},
"author": "aspulse <[email protected]>",
"keywords": [
"react",
"front-end"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
},
"files": [
"dist"
],
"scripts": {
"typecheck": "tsc --noEmit --composite false",
"lint": "eslint ."
},
"dependencies": {
"@kuma-ui/sheet": "workspace:*",
"@kuma-ui/system": "workspace:*",
"@types/stylis": "^4.2.0",
"stylis": "^4.2.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@types/react": "^18.0.32",
"@types/testing-library__jest-dom": "^5.14.9",
"@vitest/coverage-c8": "^0.31.4",
"globby": "^13.2.0",
"jsdom": "^22.1.0",
"ts-node": "^10.9.1",
"vitest": "^0.31.4"
},
"peerDependencies": {
"@types/react": "^18.0.32",
"next": ">=13.4.5",
"react": ">=18.2.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"next": {
"optional": true
}
},
"publishConfig": {
"access": "public"
}
}

0 comments on commit 30597f2

Please sign in to comment.