Skip to content

Commit

Permalink
Merge pull request #1100 from statisticsnorway/MIM-1890_table_component
Browse files Browse the repository at this point in the history
Table Component: Part 1
  • Loading branch information
johnnadeluy authored Jun 12, 2024
2 parents 1f74a02 + 439e330 commit 00f4369
Show file tree
Hide file tree
Showing 16 changed files with 990 additions and 21 deletions.
9 changes: 6 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
["@babel/preset-env", {
"modules": false
}],
"@babel/preset-react"
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": [
["module-resolver",
{
"extensions": [
".js",
".jsx"
".jsx",
".ts",
".tsx"
],
"root": [
"./src"
]
}
],
["prismjs", {
"languages": ["javascript", "html", "css", "jsx"],
"languages": ["javascript", "html", "css", "jsx", "typescript", "tsx"],
"plugins": ["line-numbers"],
"theme": "coy",
"css": true
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/coverage
/build
**/*.test.jsx
**/*.test.tsx
33 changes: 29 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
{
"extends": "airbnb",
"extends": [
"airbnb",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors"
],
"plugins": [
"@typescript-eslint",
"import"
],
"env": {
"browser": true,
"es6": true,
"jest": true
},
"parser": "@babel/eslint-parser",
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"rules": {
"arrow-parens": ["error", "as-needed"],
"func-names": ["error", "never"],
Expand All @@ -28,6 +43,7 @@
"react/jsx-indent": [1, "tab"],
"react/jsx-indent-props": [1, "tab"],
"react/jsx-one-expression-per-line": 0,
"react/jsx-filename-extension": [1, { "extensions": [".jsx", ".tsx"] }],
"react/require-default-props": 0,
"react/sort-comp": [1, {
"order": [
Expand All @@ -37,15 +53,24 @@
"everything-else"
]}
],

"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/no-static-element-interactions": 1,
"jsx-a11y/label-has-associated-control": ["error", {
"required": {
"some": ["nesting", "id"]
}
}],
"no-use-before-define": ["error", { "functions": false, "classes": true }]
"no-use-before-define": ["error", { "functions": false, "classes": true }],
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
]
},
"globals": {
"document": false,
Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm run lint
npm run test
4 changes: 2 additions & 2 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');

module.exports = {
stories: ['../**/*.story.jsx'],
stories: ['../**/*.story.@(jsx|tsx)'],

addons: [
'@storybook/addon-links',
Expand Down Expand Up @@ -35,7 +35,7 @@ module.exports = {
},

resolve: {
extensions: ['.jsx', '.js'],
extensions: ['.jsx', '.js', '.tsx', '.ts'],
},

features: {
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
'src/components',
'src/style',
],
moduleFileExtensions: ['js', 'jsx'],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/fileMock.js',
'\\.(css|scss)$': '<rootDir>/src/main.scss',
Expand Down
Loading

0 comments on commit 00f4369

Please sign in to comment.