-
Notifications
You must be signed in to change notification settings - Fork 700
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal: migrate off nimbus (#1609)
* internal(dev/babel): migrate off nimbus * internal(dev/prettier): migrate off nimbus * internal(dev/prettier): add more ignore patterns * internal(dev/eslint): migrate off nimbus * internal(dev/typescript): remove nimbus deps, config, gitignore * internal(dev/typescript): commit all tsconfigs * internal(dev/jest): remove nimbus deps, add jest deps, update gitignore * internal(dev/eslint): eslint-presets/* => config-eslint/* * internal(dev/jest): add jest.config.js + setup files * internal(dev/types): add and run scripts/updateTsReferences * fix(demo): fix tsconfig * internal(dev/type): remove verbose in type script * internal(dev/jest): add mocks, fix enzyme setup, fix script * deps: remove nimbus * yarn lint --fix * fix(dev/eslint): fix babel parser * fix(lint): batch of manual fixes * fix(lint): another batch of manual fixes * fix(lint): another batch of manual fixes * fix: run prettier * fix(axis): fix Orientation type * fix(xychart): fix event types * dev(CONTRIBUTING): update single-package build + type scripts * fix(xychart): more event type fixes * fix(demo): happo/* => src/happo/* * fix(zoom): return ReactElement not ReactNode * fix(lint): try to fix parser * fix(lint): try to fix parser * fix: bump required node version to >16.10.0 * lint(demo/happo) * fix(demo/text): fix happo name
- Loading branch information
1 parent
0cb5b2f
commit fa743a4
Showing
377 changed files
with
74,993 additions
and
4,850 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,76 @@ | ||
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: { | ||
'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
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,95 @@ | ||
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 = { | ||
parser: '@babel/eslint-parser', | ||
|
||
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.