callstack / eslint-config-callstack Goto Github PK
View Code? Open in Web Editor NEWESLint preset extending Flow, Prettier and Jest
License: MIT License
ESLint preset extending Flow, Prettier and Jest
License: MIT License
MacOS + VSCode
The last step of the installation guide recommends to add addition settings for VSCode. Looks like it is already a little bit deprecated.
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
As we use this config for lot of React Native projects, right now if we have a .android.js
and a .ios.js
file and we do not have the counterpart (just .js
), eslint will throw errors.
We can just add import-js/eslint-plugin-import#279 (comment).
I'll PR when i get a second.
I've built my own personal config based on this one.
Someone can take it, just replace the rules and it should be ready to go.
https://github.com/jukben/eslint-config
For instance we don't need eslint-restricted-globals – it's already in eslint-config-airbnb-base,...
cc @ferrannp
There's few additional steps needed to make this run inside VSCode - might be a good idea to mention the following need to be added to settings.json
:
{
"eslint.validate": [
"javascript",
"javascriptreact",
{"language": "typescript", "autoFix": true },
{"language": "typescriptreact", "autoFix": true }
]
}
In order to take advantage of some new features with typescript 3.8 it would be great to bump to prettier 2 which was recently released.
I can try to see how this effects some code bases already using this eslint-config.
I am running into a scenario where I declare an HOC component, and then export it using React.forwardRef() in the same file. This is triggering an error that I have 2 components declared in 1 file.
This option can be disabled for essentially HOC components:
"react/no-multi-comp": [<enabled>, { "ignoreStateless": <boolean> }]
I'd like to propose adding that tweak. Otherwise, can it be explained how to resolve the rule firing when using forwardRef()?
3.9.0
to 3.9.1
.This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-flowtype is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 1 commits.
712d840
fix: requireReadOnlyReactProps (#406)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Explicit types for function return values and arguments makes it clear to any calling code what is the module boundary's input and output.
This might be a big change for some of the projects that use this config, so it should be considered as breaking change.
It improves debugging and makes sure that returned types are correct.
Our config is using [email protected]
, but newer CRA is installing version 9.0.0
so when running react-scripts start
the user is greeted with this nice error:
The question is should we do anything with it? Maybe bump babel-eslint
??
System:
OS: macOS 14.1
CPU: (10) arm64 Apple M1 Pro
Memory: 889.69 MB / 32.00 GB
Shell: 3.6.1 - /opt/homebrew/bin/fish
Binaries:
Node: 18.18.2 - /usr/local/bin/node
Yarn: 4.0.2 - /opt/homebrew/bin/yarn
npm: 9.7.2 - /opt/homebrew/bin/npm
bun: 1.0.0 - ~/.bun/bin/bun
Watchman: 2023.09.04.00 - /opt/homebrew/bin/watchman
Can't use this plugin with [email protected]
& @callstack/[email protected] , 13.x, 12.x
ESLint: 8.53.0
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]:
Failed to load plugin 'import' declared in '.eslintrc.js
» @callstack/eslint-config
» /Users/davydnarbutovich/all_work/ck/dtv/app/libs/navigation/node_modules/@callstack/eslint-config/react.js
» /Users/davydnarbutovich/all_work/ck/dtv/app/libs/navigation/node_modules/@callstack/eslint-config/node.js':
Package subpath './lib/util/glob-util' is not defined by "exports" in
/Users/davydnarbutovich/all_work/ck/dtv/app/libs/navigation/node_modules/eslint/package.json
...
For React projects that are not React Native. Once extracted, RN would extend from it, similar as we do with Node config.
There's demand
Source: https://twitter.com/geteslint/status/944829414159810560
We need to make sure babel-eslint@8 works with older versions of eslint (between 4.0 - 4.13).
22.9.0
to 22.10.0
.This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-jest is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 7 commits.
28bd1dc
feat(rules): adds no-if
rule (#293)
7ebdc0e
chore: enforce import destructure order
31c7cef
chore: convert to import/export (#302)
9f858cb
chore: delete tests instead of ignoring them with babel
c595ba0
chore: do not include tests in published tarball
4b4eb78
chore: fix lint error in md file
d3ea720
chore(docs): fix typo (#304)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
Or should we wait for scoped @callstack/eslint-config
?
7.14.0
to 7.14.1
.This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-react is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 3 commits.
62255af
Update CHANGELOG and bump version
655eb01
Merge pull request #2320 from golopot/issue-2319
9639d82
[Fix] prop-types
: fix crash on multiple destructuring
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
https://github.com/FormidableLabs/eslint-plugin-react-native-a11y/releases/tag/v2.0.0
Accessibility!
1.9.0
to 1.10.0
.This version is covered by your current version range and after updating it in your project the build failed.
@typescript-eslint/parser is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
With some basic examples just to be sure we're keeping it right
Consider enabling caseSensitiveStrict
for import/no-unresolved
rule to avoid issues on case-sensitive vs case-insensitive filesystems.
22.5.1
to 22.6.0
.This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-jest is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 9 commits.
14d83ef
feat(rules): add no-commented-out rule (#262)
83ff198
chore: migrate no-jest-import to typescript (#259)
718c08c
chore: upgrade @typescript-eslint
ca2aa27
chore: port lowercase-name to TypeScript (#258)
3df0058
chore(ci): run danger with lts version of node
48e3a59
chore: precompile with babel (#257)
8670804
chore: bump deps
05eb11a
chore: fix lint error
dff6446
docs: link to eslint-plugin-jest-formatting
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
1.9.0
to 1.10.0
.This version is covered by your current version range and after updating it in your project the build failed.
@typescript-eslint/eslint-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
This will get rid of:
can't resolve reference #/definitions/basicConfig from id #
can't resolve reference #/definitions/basicConfigOrBoolean from id #
can't resolve reference #/definitions/basicConfigOrBoolean from id #
Deterministic imports are nice to have, what do you think about including this plugin by default? It's like Prettier, but for import order.
https://github.com/lydell/eslint-plugin-simple-import-sort
Fixable, deterministic import ordering.
I see this in our codebase with the current rulset:
C:\Users\matt\workspace\app\packages\home-ui\src\components\Home\__tests__\index.test.js
6:1 error 'test-utils' should be listed in the project's dependencies. Run 'npm i -S test-utils' to add it import/no-extraneous-dependencies
In this particular instance, 'test-utils' is another package in the monorepo located at C:\Users\matt\workspace\app\packages\test-utils
. (Even so, it seems like a bug in eslint-plugin-import that they say to add a test dependency to regular dependencies instead of devDependencies.)
In our local eslintrc we have this override in our configuration to eliminate this class of false-positive warnings (and a few others) :
module.exports = {
"extends": [
"@sie/eslint-config-react-native-app",
],
"overrides": [
{
"files": ["scripts/**/*.js", "**/*mock*/**/*.js", "**/__tests__/**/*.js"],
"rules": {
"global-require": "off",
"import/no-extraneous-dependencies": "off",
"one-var": "off",
}
}
],
}
eslint-plugin-import does have a way to specify package directories to accomodate monorepos, but I'm not sure if that could be used generically in this config package since monorepos structure can vary quite a bit.
Does someone have an idea how to use the packageDir option to this rule to not fire on this case? Would a PR to turn off this rule for test and mock directories be accepted?
22.14.1
to 22.15.0
.This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-jest is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 7 commits.
f41d5c4
feat(rules): no-expect-resolves (#364)
a334368
chore: convert index file to typescript (#372)
e060061
chore(snapshot-processor): convert to typescript (#371)
b61ec87
chore: copy over json files when running babel
85e4195
chore: add no-negated-condition lint rule
d285f8b
chore: move globals into json file (#366)
8dcfc24
chore(no-large-snapshots): refactor away babel-eslint
in tests (#367)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
It is quite annoying rule. I found myself lot of times defining constants and I want to use just export
. I know that in the future there will be more. I am responsible enough to know how to export my files :D
For bumping deps
We should blacklist some global variables such as name
which often cause confusion. Looking for a list.
Make sure the config doesn't choke on import * as fs from 'node:fs'
and alike.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.