Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge power_linting #30

Merged
merged 80 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
3b45c41
Initial commit
wadewinningham May 13, 2022
8a19945
Make heroes-for-hire team CODEOWNERS of this repo (#1)
wadewinningham May 13, 2022
3aef920
Ruby linting gems (#2)
xjunior May 19, 2022
db7b670
Publish to rubygems from workdir (#3)
xjunior May 19, 2022
9e054e1
Fix release (#4)
xjunior May 19, 2022
533b2c8
Correct links (#5)
benlangfeld May 19, 2022
1982c38
Comply with our own rules in the docs (#6)
benlangfeld May 19, 2022
04bd3fa
Build on ruby 3.1.2 (#7)
xjunior May 20, 2022
a0e8dc3
Add Garett as author (#11)
garettarrowood May 23, 2022
13fc738
Create ViewComponent file placement cop (#10)
garettarrowood May 23, 2022
cdc75de
ES Linting lib (#12)
xjunior May 24, 2022
6181065
Add publish config to make @powerhome/eslint-config public (#14)
xjunior May 24, 2022
a31bbca
Configure Renovate (#13)
renovate[bot] May 24, 2022
d50ff78
Allow for ApplicationComponent namespacing (#25)
garettarrowood May 26, 2022
1da50bd
Create Naming/ViewComponent cop (#26)
garettarrowood May 26, 2022
2fca3ae
Bump rack from 2.2.3 to 2.2.3.1 in /rubocop-powerhome (#29)
dependabot[bot] May 30, 2022
65e759c
Bump rack from 2.2.3 to 2.2.3.1 in /rubocop-cobra (#30)
dependabot[bot] May 30, 2022
43c8408
Create Style/NoHelpers cop (#28)
garettarrowood May 31, 2022
40f1245
Update tj-actions/changed-files action to v22 (#31)
renovate[bot] Jun 1, 2022
2e02329
Bump to 0.4.0 (#32)
garettarrowood Jun 1, 2022
7b08dae
Update actions/checkout action to v3 (#18)
renovate[bot] Jun 1, 2022
1c67d17
Fix Naming/ViewComponent - Patch to 0.4.1 (#33)
garettarrowood Jun 2, 2022
9f7d71c
Initial portal setup (#34)
xjunior Jun 3, 2022
810fa83
Pin dependency babel-eslint to v (#15)
renovate[bot] Jun 3, 2022
83ab0a1
Give more useful output on violations (#36)
benlangfeld Jun 8, 2022
edfc760
Fix rel links in README (#37)
ryanmrodriguez Jun 8, 2022
f1c11ec
Lock file maintenance (#35)
renovate[bot] Jun 21, 2022
583c17e
Ensure license compliance (#41)
that-jill Jul 15, 2022
07f4d2c
Lock file maintenance (#40)
renovate[bot] Jul 17, 2022
ebbe528
Update tj-actions/changed-files action to v23 (#39)
renovate[bot] Jul 18, 2022
f64d326
Update all non-major dependencies (#16)
renovate[bot] Jul 19, 2022
f30df5c
Update dependency babel-eslint to v10 (#19)
renovate[bot] Jul 19, 2022
17dcffe
Update dependency eslint-plugin-flowtype to v8 (#21)
renovate[bot] Jul 19, 2022
14ebb5f
Update dependency eslint-plugin-jsx-control-statements to v3 (#22)
renovate[bot] Jul 19, 2022
3a939da
Update dependency eslint-webpack-plugin to v3 (#23)
renovate[bot] Jul 19, 2022
a865fb3
Update typescript-eslint monorepo to v5 (major) (#24)
renovate[bot] Jul 19, 2022
c9711dd
Lock file maintenance (#42)
renovate[bot] Jul 19, 2022
9e3204e
Update all non-major dependencies (#44)
renovate[bot] Jul 19, 2022
1d51fa4
Ignore rspec's describe and context on BlockLength (#43)
xjunior Jul 19, 2022
adee4f9
Update dependency babel-eslint to v10 (#45)
renovate[bot] Jul 20, 2022
97c17b4
Update dependency rubocop to ~> 1.32.0 (#46)
renovate[bot] Jul 21, 2022
f9cfb91
Update tj-actions/changed-files action to v24 (#47)
renovate[bot] Jul 22, 2022
9ef866f
Release version 0.5.0 (#48)
xjunior Jul 22, 2022
4681ef8
Release by tag name (#49)
xjunior Jul 22, 2022
80b66d2
Remove unnecessary release conditional (#50)
xjunior Jul 22, 2022
69dc46d
custom release command (#51)
xjunior Jul 22, 2022
8ef555b
custom release command (#52)
xjunior Jul 22, 2022
d14cbc4
Update all non-major dependencies to v5.32.0 (#54)
renovate[bot] Aug 2, 2022
ce20c58
Lock file maintenance (#53)
renovate[bot] Aug 2, 2022
1c8a59b
Update all non-major dependencies (#55)
renovate[bot] Aug 23, 2022
b10f42b
Lock file maintenance (#56)
renovate[bot] Aug 24, 2022
bb2090a
Update all non-major dependencies (#57)
renovate[bot] Aug 25, 2022
4367b8d
Update dependency typescript to v4.8.2 (#59)
renovate[bot] Aug 26, 2022
ee20ba7
Update all non-major dependencies (#60)
renovate[bot] Aug 30, 2022
6049107
Lock file maintenance (#61)
renovate[bot] Aug 30, 2022
a0d9c69
Update all non-major dependencies to v5.36.1 (#62)
renovate[bot] Aug 31, 2022
9ecadea
Update dependency rubocop to "~> 1.36.0" (#63)
renovate[bot] Sep 2, 2022
a1a9aa5
Update all non-major dependencies (#64)
renovate[bot] Sep 6, 2022
42fd863
Update all non-major dependencies (#66)
renovate[bot] Sep 12, 2022
a1379b6
Update all non-major dependencies to v5.37.0 (#67)
renovate[bot] Sep 12, 2022
920aafa
Lock file maintenance (#65)
renovate[bot] Sep 13, 2022
d7c28a0
Lock file maintenance (#68)
renovate[bot] Sep 19, 2022
266e94e
Update dependency @typescript-eslint/parser to v5.38.0 (#69)
renovate[bot] Sep 19, 2022
2c2b182
Update dependency @typescript-eslint/eslint-plugin to v5.38.0 (#70)
renovate[bot] Sep 20, 2022
3f51f9b
Lock file maintenance (#73)
renovate[bot] Sep 26, 2022
ea153c1
Update dependency node to v14.20.1 (#71)
renovate[bot] Sep 26, 2022
48e1188
Update all non-major dependencies to v5.38.1 (#74)
renovate[bot] Sep 27, 2022
e3948d3
Lock file maintenance (#76)
renovate[bot] Oct 20, 2022
d12c7b4
Lock file maintenance (#77)
renovate[bot] Oct 24, 2022
60c8fb0
Update dependency node to v16 (#72)
renovate[bot] Oct 24, 2022
57ac6bf
Update all non-major dependencies (#75)
renovate[bot] Oct 24, 2022
ca9874e
Add 'packages/power_linting/' from commit '57ac6bfbfd00dce576d168e2ee…
xjunior Oct 26, 2022
5ad2238
Move rubocop-cobra
xjunior Oct 26, 2022
7362200
Move rubocop-powerhome
xjunior Oct 26, 2022
bf65fbe
Run rubocop-powerhome with multiple versions of rails
xjunior Oct 26, 2022
d729087
Ignore rails version to run rubocop-cobra
xjunior Oct 26, 2022
8ae00e7
Ignore Gemfile.lock to support multiple rails versions
xjunior Oct 26, 2022
e96930a
Make rubocop happy - it thinks create is calling FactoryBot.create
xjunior Oct 26, 2022
2cb951d
Move eslint-config
xjunior Oct 26, 2022
7fbbdee
Move documentation and portal setup from power-linting to power-tools
xjunior Oct 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/eslint-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: eslint-config

on:
push:

env:
PROJECT_DIR: packages/eslint-config
NODE_VERSION: '14.18.1'
REGISTRY_URL: 'https://registry.npmjs.org'

jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v3
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: yarn install --frozen-lockfile
working-directory: ${{ env.PROJECT_DIR }}
- name: Run the build script
run: yarn lint
working-directory: ${{ env.PROJECT_DIR }}

release:
needs: build
runs-on: ubuntu-latest
name: Release
if: ${{ contains(github.ref, 'refs/tags/v') && contains(github.ref, github.workflow) }}
steps:
- uses: actions/checkout@v3
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: ${{ env.REGISTRY_URL }}
- run: yarn install --frozen-lockfile
working-directory: ${{ env.PROJECT_DIR }}
- run: yarn publish
working-directory: ${{ env.PROJECT_DIR }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/rubocop-cobra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: rubocop-cobra

on:
push:

jobs:
ruby:
uses: ./.github/workflows/_ruby-package.yml
with:
package: ${{ github.workflow }}
ruby: '["2.7.4", "3.1.2"]'
rails: '["any"]'
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/rubocop-powerhome.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: rubocop-powerhome

on:
push:

jobs:
ruby:
uses: ./.github/workflows/_ruby-package.yml
with:
package: ${{ github.workflow }}
ruby: '["2.7.4", "3.1.2"]'
rails: '["7.0.3.1","6.1.6.1","6.0.5.1","5.2.8.1"]'
that-jill marked this conversation as resolved.
Show resolved Hide resolved
secrets: inherit
12 changes: 12 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ Lumberaxe handles logging output formatting.

Consent provides permission-based authorization.

[rubocop-powerhome](https://github.com/powerhome/power-tools/blob/main/packages/rubocop-powerhome/docs/README.md) 💎

This gem is focused on providing standard rubocop configuration for Power Home Remodeling ruby apps. See more in [`rubocop-powerhome`](../packages/rubocop-powerhome).

[rubocop-cobra](https://github.com/powerhome/power-tools/blob/main/packages/rubocop-cobra/docs/README.md) 💎

This gem is focused on providing Cops to support a healthy cobra app development. See more in [`rubocop-cobra`](../packages/rubocop-cobra).

[@powerhome/eslint-config](https://github.com/powerhome/power-tools/blob/main/packages/eslint-config/docs/README.md)

Shared eslint-config from Power Home Remodeling.

## Installation 🛠

These packages are all meant to install inside of an application and aren't intended to stand alone; currently, they are all published to [RubyGems](https://rubygems.org/) and you can use standard Bundler methods to install them.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

# rubocop:disable RSpec/FactoryBot/ConsistentParenthesesStyle
AuditTracker.setup do
tracker(:user) do
create :created_by, foreign_key: :created_by_id, class_name: "::Internal::User"
Expand All @@ -16,3 +17,4 @@
value: ->(object) { object&.updated_by&.department }
end
end
# rubocop:enable RSpec/FactoryBot/ConsistentParenthesesStyle
1 change: 1 addition & 0 deletions packages/eslint-config/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "@powerhome/eslint-config/base" }
4 changes: 4 additions & 0 deletions packages/eslint-config/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.tmp
node_modules/
**/*.d.ts
**/*.d.ts.map
48 changes: 48 additions & 0 deletions packages/eslint-config/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# @powerhome/eslint-config

Provides eslint-config for Power Home Remodeling apps.

## Installation

Add this line to your application's package.json:

```ruby
"devDependencies": {
...
"@powerhome/eslint-config": "0.1.0",
...
}
```

And then yarn:

$ yarn

## Usage

Assuming it's a typescript app, add an `extends` line to your `.eslintrc.json`:

```js
{
...
extends: [
...
"@powerhome",
],
...
}
```

That's it! You can override the standard configuration after that.

## Flow type apps

For flow-based apps, replace `@powerhome` by `@powerhome/eslint-config/flow`. Note that usage of Flow at Power is not recommended, and all projects should migrate to TypeScript; this set of rules is provided only for transitionary purposes and will be removed in future releases.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/powerhome/power_linting.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
67 changes: 67 additions & 0 deletions packages/eslint-config/lib/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
module.exports = {
root: true,
plugins: ["jsx-control-statements", "react", "react-hooks"],
extends: [
"eslint:recommended",
"plugin:jsx-control-statements/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
],
parser: "babel-eslint",
parserOptions: {
ecmaVersion: 6,
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
es6: true,
"jsx-control-statements/jsx-control-statements": true,
node: true,
mocha: true,
},
rules: {
"jsx-control-statements/jsx-jcs-no-undef": 1,
"no-console": 1,
"no-restricted-globals": [1, { name: "moment" }],
"no-use-before-define": [2, { functions: true, classes: true }],
"react/forbid-prop-types": 2,
"react/jsx-boolean-value": 2,
"react/jsx-closing-bracket-location": 1,
"react/jsx-curly-spacing": 2,
"react/jsx-handler-names": 2,
"react/jsx-indent-props": 2,
"react/jsx-key": 2,
"react/jsx-max-props-per-line": 2,
"react/jsx-no-bind": 0,
"react/jsx-no-literals": 1,
"react/jsx-no-undef": [2, { allowGlobals: true }],
"react/jsx-pascal-case": 2,
"react/jsx-sort-props": 2,
"react/jsx-wrap-multilines": 2,
"react/no-danger": 1,
"react/no-did-mount-set-state": 2,
"react/no-did-update-set-state": 2,
"react/no-multi-comp": 1,
"react/no-set-state": 1,
"react/prefer-es6-class": 2,
"react/prop-types": 1,
"react/self-closing-comp": 2,
"react/sort-comp": 1,
},
settings: {
react: {
version: "detect",
},
},
ignorePatterns: [
"**/*.d.ts",
"coverage/**/*",
"doc/**/*",
"node_modules/**/*",
"spec/dummy/**/*",
"vendor/**/*",
],
}
8 changes: 8 additions & 0 deletions packages/eslint-config/lib/flow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: [
"@powerhome/eslint-config/base",
"plugin:flowtype/recommended"
],
plugins: ["flowtype"],
ignorePatterns: ["flow-typed/**/*"],
}
24 changes: 24 additions & 0 deletions packages/eslint-config/lib/typescript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
extends: ["@powerhome/eslint-config/base"],
overrides: [
{
files: ["**/*.ts", "**/*.tsx"],
extends: ["plugin:@typescript-eslint/recommended"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
rules: {
"flowtype/no-types-missing-file-annotation": 0,
"jsx-control-statements/jsx-use-if-tag": 0,
"no-use-before-define": 0,
"@typescript-eslint/no-array-constructor": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-unused-vars": 1,
"@typescript-eslint/no-use-before-define": [
2,
{ functions: true, classes: true },
],
},
},
],
}
9 changes: 9 additions & 0 deletions packages/eslint-config/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
site_name: ESLint Config Powerhome
site_description: Provides eslint-config for Power Home Remodeling apps
repo_url: https://github.com/powerhome/power_linting
edit_uri: edit/main/eslint-config/docs/
nav:
- 'Home': 'README.md'

plugins:
- techdocs-core
46 changes: 46 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "@powerhome/eslint-config",
"version": "0.1.0",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"exports": {
"./base": "./lib/base.js",
"./flow": "./lib/flow.js",
"./typescript": "./lib/typescript.js",
".": "./lib/typescript.js"
},
"keywords": [
"eslint",
"eslintconfig"
],
"scripts": {
"lint": "eslint lib/*"
},
"peerDependencies": {
"eslint": "7.32.0",
"eslint-plugin-flowtype": "8.0.3",
"eslint-plugin-jsx-control-statements": "3.0.0",
"eslint-plugin-react": "7.31.10",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-webpack-plugin": "3.2.0",
"@typescript-eslint/eslint-plugin": "5.41.0",
"@typescript-eslint/parser": "5.41.0",
"babel-eslint": "8 || 10",
"typescript": "4.8.4"
},
"devDependencies": {
"semver": "7.3.8",
"eslint": "7.32.0",
"eslint-plugin-flowtype": "8.0.3",
"eslint-plugin-jsx-control-statements": "3.0.0",
"eslint-plugin-react": "7.31.10",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-webpack-plugin": "3.2.0",
"@typescript-eslint/eslint-plugin": "5.41.0",
"@typescript-eslint/parser": "5.41.0",
"babel-eslint": "10.1.0",
"typescript": "4.8.4"
}
}
Loading