| name | description |
|---|---|
no-use-effect |
Enforce the no-useEffect rule when writing or reviewing React code.
ACTIVATE when writing React components, refactoring existing useEffect calls,
reviewing PRs with useEffect, or when an agent adds useEffect "just in case."
Provides the five replacement patterns and the useMountEffect escape hatch.
|
This file contains hidden or 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
| # in config/environment.rb | |
| if ENV['SPRING_ENV'] == 'test' && ENV['RAILS_ENV'] == 'test' | |
| require File.expand_path('../../spec/spec_helper', __FILE__) | |
| end | |
| # in spec_helper.rb | |
| # runs in Spring parent | |
| unless MySpecHelper.factory_sequences | |
| DatabaseCleaner.clean_with(:truncation) | |
| RESEED_DB.call | |
| MySpecHelper.factory_sequences = FactoryGirl.sequences |
This file contains hidden or 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
| # In spec/factories/account.rb | |
| FactoryBot.define do | |
| sequence(:email) { |n| "test_email_#{n}@example.com" } | |
| end | |
| # In Spring parent | |
| def seed_db | |
| 100.times { create(:account) } | |
| end | |
| seed_db # creates 100 accounts with sequences 1 to 100 | |
| MySpecHelper.factory_sequences = FactoryGirl.sequences |
This file contains hidden or 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
| # In spec/factories/account.rb | |
| FactoryBot.define do | |
| sequence(:email) { |n| "test_email_#{n}@example.com" } | |
| end | |
| # In Spring parent | |
| def seed_db | |
| 100.times { create(:account) } | |
| end | |
| seed_db # creates 100 accounts with sequences 1 to 100 | |
| # In Spring fork's spec run |
This file contains hidden or 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
| # in spec_helper.rb | |
| RSpec.configure do |config| | |
| # other spec configs here | |
| config.around(:each) do |example| | |
| DatabaseCleaner.cleaning do | |
| example.run | |
| end | |
| end | |
| end |
This file contains hidden or 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
| # in config/environment.rb | |
| # Load the Rails application. | |
| require File.expand_path('../application', __FILE__) | |
| # Initialize the Rails application. | |
| Rails.application.initialize! | |
| # If in Spring & test env, load spec_helper.rb | |
| if ENV['SPRING_ENV'] == 'test' && ENV['RAILS_ENV'] == 'test' | |
| require File.expand_path('../../spec/spec_helper', __FILE__) | |
| end |
This file contains hidden or 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
| RESEED_DB = -> do | |
| DbSeedsHelper.create_default_customer_data_types | |
| DbSeedsHelper.create_markets | |
| DbSeedsHelper.create_organizations | |
| DbSeedsHelper.create_owner_entities | |
| DbSeedsHelper.create_system_human | |
| DbSeedsHelper.create_seller_flows | |
| DbSeedsHelper.create_title_orgs | |
| end |
This file contains hidden or 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
| var React = require('react'); | |
| module.exports = React.createClass({ | |
| displayName: 'AltManagerContainer', | |
| propTypes: { | |
| Action: React.PropTypes.function.isRequired, | |
| Store: React.PropTypes.function.isRequired, | |
| alt: React.PropTypes.object.isRequired, |