-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(reveal-react-components): add formatting and linting (#3422)
* chore: restructure folder layout * asd * asd * feat: add RevealContainer * fix: update transformation when updating prop * fix: conflicts * fix: update storybook setup * fix: update reveal version * chore: setup eslint linting and prettier formatting * chore: run formatter * chore: add prettier plugin to eslintconfig * chore: replace deprecated prettier config param * fix: add proper import * fix: remove unused scripts and update tsconfig * fix: set proper base URL for build * fix: config and linting * chore: use ReactElement * chore: add copywrite header rule * chore: remove unused patter * fix: refactor out some functions * chore: add eslint cache * fix: add consistent type and eqeqeq lint rules --------- Co-authored-by: cognite-bulldozer[bot] <51074376+cognite-bulldozer[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f6554e1
commit caa598f
Showing
26 changed files
with
14,831 additions
and
14,248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
"@babel/preset-react" | ||
], | ||
"plugins": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dist/* | ||
node_modules/* | ||
.yarn/* | ||
.storybook/* | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true | ||
}, | ||
extends: [ | ||
'standard-with-typescript', | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:prettier/recommended' | ||
], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: ['./tsconfig.json'] | ||
}, | ||
plugins: ['react', 'prettier', 'header'], | ||
rules: { | ||
'react/react-in-jsx-scope': 'off', | ||
'@typescript-eslint/consistent-type-definitions': ['error', 'type'], | ||
eqeqeq: ['error', 'always'] | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect' | ||
} | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['src/**/*.ts', 'src/**/*.tsx', 'stories/**/*.ts', 'stories/**/*.tsx'], | ||
rules: { | ||
'header/header': [ | ||
'error', | ||
'block', | ||
[ | ||
{ | ||
pattern: `(Copyright 20\\d{2}|istanbul ignore)`, | ||
template: `!\n * Copyright ${new Date().getFullYear()} Cognite AS\n ` | ||
} | ||
] | ||
] | ||
} | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"semi": true, | ||
"tabWidth": 2, | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"bracketSameLine": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import type { StorybookConfig } from "@storybook/react-webpack5"; | ||
import type { StorybookConfig } from '@storybook/react-webpack5'; | ||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], | ||
stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions' | ||
], | ||
framework: { | ||
name: "@storybook/react-webpack5", | ||
options: {}, | ||
name: '@storybook/react-webpack5', | ||
options: {} | ||
}, | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
autodocs: 'tag' | ||
} | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import type { Preview } from "@storybook/react"; | ||
import type { Preview } from '@storybook/react'; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
date: /Date$/ | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export default preview; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.