Skip to content

Commit

Permalink
chore: actualize .editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
xobotyi committed Jun 30, 2023
1 parent 6a82ac5 commit fe83195
Show file tree
Hide file tree
Showing 305 changed files with 9,909 additions and 9,898 deletions.
16 changes: 7 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
root = true

[*]
charset = utf-8
indent_style = tab
tab_width = 2
end_of_line = lf
indent_size = 2
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
tab_width = 2
trim_trailing_whitespace = true

[*.{md,mdx}]
trim_trailing_whitespace = false
indent_size = unset
max_line_length = 100
[*.yml]
indent_style = space
indent_size = 2
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ storybook-build
CHANGELOG.md
!.eslintrc.js
!.prettierrc.js
!.storybook
!.github
133 changes: 72 additions & 61 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,76 @@
module.exports = {
root: true,
root: true,

parserOptions: {
project: './tsconfig.eslint.json',
extraFileExtensions: ['.md', '.mdx'],
},
parserOptions: {
extraFileExtensions: ['.md', '.mdx'],
},

overrides: [
{
files: ['*.js'],
extends: ['@react-hookz/eslint-config/base.cjs'],
},
{
files: ['*.jsx'],
extends: ['@react-hookz/eslint-config/base.cjs', '@react-hookz/eslint-config/react.cjs'],
},
{
files: ['*.ts'],
extends: ['@react-hookz/eslint-config/typescript.cjs'],
},
{
files: ['*.tsx'],
extends: [
'@react-hookz/eslint-config/typescript.cjs',
'@react-hookz/eslint-config/react.cjs',
],
},
{
files: ['**/__tests__/**/*.js'],
extends: ['@react-hookz/eslint-config/base.cjs', '@react-hookz/eslint-config/jest.cjs'],
},
{
files: ['**/__tests__/**/*.jsx'],
extends: [
'@react-hookz/eslint-config/base.cjs',
'@react-hookz/eslint-config/react.cjs',
'@react-hookz/eslint-config/jest.cjs',
],
},
{
files: ['**/__tests__/**/*.ts'],
extends: [
'@react-hookz/eslint-config/typescript-unsafe.cjs',
'@react-hookz/eslint-config/jest.cjs',
],
},
{
files: ['**/__tests__/**/*.tsx'],
extends: [
'@react-hookz/eslint-config/typescript-unsafe.cjs',
'@react-hookz/eslint-config/react.cjs',
'@react-hookz/eslint-config/jest.cjs',
],
},
{
files: ['*.md'],
extends: ['@react-hookz/eslint-config/md.cjs'],
},
{
files: ['*.mdx'],
extends: ['@react-hookz/eslint-config/mdx.cjs'],
},
],
overrides: [
{
files: ['*.js'],
extends: ['@react-hookz/eslint-config/base.cjs'],
},
{
files: ['*.jsx'],
extends: ['@react-hookz/eslint-config/base.cjs', '@react-hookz/eslint-config/react.cjs'],
},
{
files: ['*.ts'],
parserOptions: {
project: './tsconfig.eslint.json',
},
extends: ['@react-hookz/eslint-config/typescript.cjs'],
},
{
files: ['*.tsx'],
parserOptions: {
project: './tsconfig.eslint.json',
},
extends: [
'@react-hookz/eslint-config/typescript.cjs',
'@react-hookz/eslint-config/react.cjs',
],
},
{
files: ['**/__tests__/**/*.js'],
extends: ['@react-hookz/eslint-config/base.cjs', '@react-hookz/eslint-config/jest.cjs'],
},
{
files: ['**/__tests__/**/*.jsx'],
extends: [
'@react-hookz/eslint-config/base.cjs',
'@react-hookz/eslint-config/react.cjs',
'@react-hookz/eslint-config/jest.cjs',
],
},
{
files: ['**/__tests__/**/*.ts'],
parserOptions: {
project: './tsconfig.eslint.json',
},
extends: [
'@react-hookz/eslint-config/typescript-unsafe.cjs',
'@react-hookz/eslint-config/jest.cjs',
],
},
{
files: ['**/__tests__/**/*.tsx'],
parserOptions: {
project: './tsconfig.eslint.json',
},
extends: [
'@react-hookz/eslint-config/typescript-unsafe.cjs',
'@react-hookz/eslint-config/react.cjs',
'@react-hookz/eslint-config/jest.cjs',
],
},
{
files: ['*.md'],
extends: ['@react-hookz/eslint-config/md.cjs'],
},
{
files: ['*.mdx'],
extends: ['@react-hookz/eslint-config/mdx.cjs'],
},
],
};
14 changes: 7 additions & 7 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ What should `@react-hookz/web` be doing?

### Environment Details

- _`@react-hookz/web` version:_
- _`react` version:_
- _`react-dom` version:_
- _`typescript` version:_
- _OS:_
- _Browser:_
- _Did this work in previous versions?_
- _`@react-hookz/web` version:_
- _`react` version:_
- _`react-dom` version:_
- _`typescript` version:_
- _OS:_
- _Browser:_
- _Did this work in previous versions?_
44 changes: 22 additions & 22 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
module.exports = {
core: {
builder: 'webpack5',
},
stories: ['../src/**/__docs__/*.mdx', '../src/**/__docs__/*.tsx'],
addons: [
'@storybook/addon-postcss',
'@storybook/addon-links',
{
name: '@storybook/addon-essentials',
options: {
backgrounds: false,
},
},
],
reactOptions: {
fastRefresh: true,
},
staticDirs: ['./public'],
managerWebpack(config, options) {
options.cache.set = () => Promise.resolve();
core: {
builder: 'webpack5',
},
stories: ['../src/**/__docs__/*.mdx', '../src/**/__docs__/*.tsx'],
addons: [
'@storybook/addon-postcss',
'@storybook/addon-links',
{
name: '@storybook/addon-essentials',
options: {
backgrounds: false,
},
},
],
reactOptions: {
fastRefresh: true,
},
staticDirs: ['./public'],
managerWebpack(config, options) {
options.cache.set = () => Promise.resolve();

return config;
},
return config;
},
};
12 changes: 6 additions & 6 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { addons } from '@storybook/addons';
import { themes } from '@storybook/theming';

addons.setConfig({
theme: {
...themes.light,
brandTitle: '@react-hookz/web',
brandImage: './logo.png',
fontBase: '"Manrope", sans-serif',
},
theme: {
...themes.light,
brandTitle: '@react-hookz/web',
brandImage: './logo.png',
fontBase: '"Manrope", sans-serif',
},
});
4 changes: 2 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const parameters = {
layout: 'centered',
viewMode: 'docs',
layout: 'centered',
viewMode: 'docs',
};
8 changes: 4 additions & 4 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'footer-max-line-length': [1, 'always', 100],
},
extends: ['@commitlint/config-conventional'],
rules: {
'footer-max-line-length': [1, 'always', 100],
},
};
72 changes: 36 additions & 36 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
import { type Config } from 'jest';

const cfg: Config = {
projects: [
{
displayName: 'dom',
transform: {
'\\.[jt]sx?$': '@swc/jest',
},
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/src/**/__tests__/dom.[jt]s?(x)'],
setupFiles: ['./src/__tests__/setup.ts'],
},
projects: [
{
displayName: 'dom',
transform: {
'\\.[jt]sx?$': '@swc/jest',
},
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/src/**/__tests__/dom.[jt]s?(x)'],
setupFiles: ['./src/__tests__/setup.ts'],
},

{
displayName: 'ssr',
transform: {
'\\.[jt]sx?$': '@swc/jest',
},
testEnvironment: 'node',
testMatch: ['<rootDir>/src/**/__tests__/ssr.[jt]s?(x)'],
},
{
displayName: 'ssr',
transform: {
'\\.[jt]sx?$': '@swc/jest',
},
testEnvironment: 'node',
testMatch: ['<rootDir>/src/**/__tests__/ssr.[jt]s?(x)'],
},

// Needed for output bundle testing
{
displayName: 'dom-package',
transformIgnorePatterns: [],
transform: {
'\\.[jt]sx?$': '@swc/jest',
},
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/src/**/__tests__/dom.[jt]s?(x)'],
setupFiles: ['./src/__tests__/setup.ts'],
moduleNameMapper: {
'^../..$': '<rootDir>',
},
},
],
collectCoverage: false,
coverageDirectory: './coverage',
collectCoverageFrom: ['./src/**/*.{ts,js,tsx,jsx}', '!**/__tests__/**', '!**/__docs__/**'],
// Needed for output bundle testing
{
displayName: 'dom-package',
transformIgnorePatterns: [],
transform: {
'\\.[jt]sx?$': '@swc/jest',
},
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/src/**/__tests__/dom.[jt]s?(x)'],
setupFiles: ['./src/__tests__/setup.ts'],
moduleNameMapper: {
'^../..$': '<rootDir>',
},
},
],
collectCoverage: false,
coverageDirectory: './coverage',
collectCoverageFrom: ['./src/**/*.{ts,js,tsx,jsx}', '!**/__tests__/**', '!**/__docs__/**'],
};

export default cfg;
Loading

0 comments on commit fe83195

Please sign in to comment.