-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
99 changed files
with
4,298 additions
and
2,370 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 |
---|---|---|
@@ -1,8 +1,16 @@ | ||
.happo/ | ||
.next/ | ||
coverage/ | ||
node_modules/ | ||
public/ | ||
esm/ | ||
lib/ | ||
tmp/ | ||
dist/ | ||
*.d.ts | ||
out/ | ||
*.d.ts | ||
lerna.json | ||
npm-shrinkwrap.json | ||
package.json | ||
package-lock.json | ||
tsconfig.json |
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,82 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
// these are relics of nimbus, we could definitely simplify + consolidate | ||
'./config-eslint/base.js', | ||
'./config-eslint/next.js', | ||
'./config-eslint/typescript.js', | ||
'./config-eslint/prettier.js', | ||
], | ||
overrides: [ | ||
{ | ||
files: '*.test.{js,jsx,ts,tsx}', | ||
rules: { | ||
'import/no-extraneous-dependencies': 'off', | ||
'jest/require-to-throw-message': 'off', | ||
}, | ||
}, | ||
{ | ||
files: '*.{js,jsx,ts,tsx}', | ||
rules: { | ||
'arrow-parens': 'off', | ||
'consistent-return': 'off', | ||
'import/prefer-default-export': 'off', | ||
'linebreak-style': 'off', | ||
'lines-between-class-members': 'off', | ||
'no-console': 'off', | ||
'no-nested-ternary': 'off', | ||
'no-param-reassign': 'warn', | ||
'no-restricted-syntax': 'off', | ||
'no-use-before-define': 'off', | ||
'no-useless-rename': 'off', | ||
'object-curly-newline': 'off', | ||
'operator-linebreak': 'off', | ||
'promise/param-names': 'off', | ||
'react/destructuring-assignment': 'off', | ||
'react/forbid-prop-types': 'off', | ||
'react/jsx-curly-brace-presence': 'off', | ||
'react/jsx-filename-extension': 'off', | ||
'react/jsx-no-literals': 'off', | ||
'react/jsx-props-no-spreading': 'off', | ||
'react/jsx-sort-default-props': 'off', | ||
'react/jsx-sort-props': 'off', | ||
'react/no-array-index-key': 'off', | ||
'react/no-children-prop': 'off', | ||
'react/require-default-props': 'off', | ||
'react/sort-comp': 'off', | ||
'react/sort-prop-types': 'off', | ||
'unicorn/catch-error-name': 'off', | ||
'unicorn/no-fn-reference-in-iterator': 'off', | ||
'unicorn/prefer-node-append': 'off', | ||
}, | ||
}, | ||
{ | ||
files: './packages/visx-demo/**', | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': [ | ||
'warn', | ||
{ | ||
fixToUnknown: false, | ||
}, | ||
], | ||
'import/no-unresolved': [ | ||
'error', | ||
{ | ||
ignore: ['^!!raw-loader!.*'], | ||
}, | ||
], | ||
'import/no-webpack-loader-syntax': 'off', | ||
'jsx-a11y/anchor-is-valid': 'off', | ||
'jsx-a11y/label-has-associated-control': 'off', | ||
'jsx-a11y/no-onchange': 'off', | ||
'no-alert': 'off', | ||
'no-param-reassign': 'off', | ||
'react/button-has-type': 'off', | ||
'react/no-danger': 'off', | ||
'react/no-unescaped-entities': 'off', | ||
'react/prop-types': 'off', | ||
'react/state-in-constructor': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
const esm = process.env.ESM; | ||
|
||
const envOptions = { | ||
loose: true, | ||
modules: esm ? false : 'commonjs', | ||
shippedProposals: true, | ||
targets: { | ||
ie: 11, | ||
}, | ||
bugfixes: false, | ||
}; | ||
|
||
const presets = [ | ||
['@babel/preset-env', envOptions], | ||
'@babel/preset-react', | ||
'@babel/preset-typescript', | ||
]; | ||
|
||
const plugins = ['babel-plugin-typescript-to-proptypes']; | ||
|
||
const ignore = [ | ||
'coverage/', | ||
'node_modules/', | ||
'public/', | ||
'esm/', | ||
'lib/', | ||
'tmp/', | ||
'dist/', | ||
'*.d.ts', | ||
'__tests__', | ||
'__mocks__', | ||
]; | ||
|
||
switch (process.env.NODE_ENV) { | ||
case 'test': { | ||
envOptions.modules = 'commonjs'; | ||
envOptions.targets = { node: 'current' }; | ||
plugins.push('babel-plugin-dynamic-import-node'); | ||
break; | ||
} | ||
|
||
case 'development': | ||
case 'production': | ||
default: { | ||
break; | ||
} | ||
} | ||
|
||
module.exports = { | ||
ignore, | ||
plugins, | ||
presets, | ||
}; |
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,97 @@ | ||
const EXTS = ['.ts', '.tsx', '.js', '.jsx', '.json']; | ||
const EXTS_GROUP = '{ts,tsx,js,jsx}'; | ||
const ASSET_EXT_PATTERN = /\.(ttf|eot|otf|svg|woff|woff2|mp3|png|jpg|jpeg|gif|ico)$/; | ||
|
||
module.exports = { | ||
root: true, | ||
|
||
parser: 'babel-eslint', | ||
|
||
parserOptions: { | ||
requireConfigFile: false, | ||
}, | ||
|
||
extends: ['airbnb', 'plugin:jsx-a11y/recommended'], | ||
|
||
plugins: ['import', 'react', 'react-hooks'], | ||
|
||
globals: { | ||
// Metrics and analytics providers | ||
ga: 'readonly', | ||
// Mostly for easier compatibility between browsers, workers, etc | ||
global: 'readonly', | ||
// Mostly references to `process.env.NODE_ENV` | ||
process: 'readonly', | ||
}, | ||
|
||
env: { | ||
browser: true, | ||
node: false, | ||
}, | ||
|
||
reportUnusedDisableDirectives: true, | ||
|
||
settings: { | ||
propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'], | ||
'import/ignore': ['node_modules', '\\.json$', ASSET_EXT_PATTERN.source], | ||
'import/extensions': EXTS, | ||
'import/resolver': { | ||
node: { | ||
extensions: EXTS, | ||
}, | ||
}, | ||
}, | ||
|
||
rules: { | ||
'react-hooks/exhaustive-deps': 'error', | ||
'react-hooks/rules-of-hooks': 'error', | ||
}, | ||
|
||
overrides: [ | ||
{ | ||
files: [`*.test.${EXTS_GROUP}`], | ||
plugins: ['jest'], | ||
globals: { | ||
jsdom: 'readonly', | ||
}, | ||
env: { | ||
jest: true, | ||
node: true, | ||
}, | ||
rules: { | ||
'max-classes-per-file': 'off', | ||
'no-magic-numbers': 'off', | ||
'sort-keys': 'off', | ||
|
||
// JEST | ||
'jest/expect-expect': 'error', | ||
'jest/no-alias-methods': 'error', | ||
'jest/no-done-callback': 'error', | ||
'jest/no-disabled-tests': 'error', | ||
'jest/no-duplicate-hooks': 'error', | ||
'jest/no-export': 'error', | ||
'jest/no-focused-tests': 'error', | ||
'jest/no-identical-title': 'error', | ||
'jest/no-if': 'error', | ||
'jest/no-jasmine-globals': 'error', | ||
'jest/no-standalone-expect': 'error', | ||
'jest/no-test-prefixes': 'error', | ||
'jest/no-test-return-statement': 'error', | ||
'jest/prefer-hooks-on-top': 'error', | ||
'jest/prefer-spy-on': 'error', | ||
'jest/prefer-todo': 'error', | ||
'jest/prefer-to-be': 'error', | ||
'jest/prefer-to-contain': 'error', | ||
'jest/prefer-to-have-length': 'error', | ||
'jest/require-to-throw-message': 'error', | ||
'jest/require-top-level-describe': 'error', | ||
'jest/valid-describe-callback': 'error', | ||
'jest/valid-expect': 'error', | ||
'jest/valid-title': 'error', | ||
|
||
// REACT | ||
'react/function-component-definition': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
Oops, something went wrong.