├── .eslintignore ├── README.md ├── .defaults.reek ├── .eslintrc.json ├── .rubocop.yml └── .scss-lint.yml /.eslintignore: -------------------------------------------------------------------------------- 1 | vendor/* 2 | spec/javascripts/* 3 | app/assets/javascripts/**/*.coffee 4 | app/assets/javascripts/**/*.cjsx 5 | app/assets/javascripts/**/*-build.js 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Linters and code analysis configs 2 | 3 | Currently in used with [ebert](https://ebertapp.io). 4 | 5 | ## References 6 | 7 | * [Ebert configuration documentation](https://docs.ebertapp.io/configuration/) 8 | -------------------------------------------------------------------------------- /.defaults.reek: -------------------------------------------------------------------------------- 1 | --- 2 | TooManyStatements: 3 | max_statements: 10 4 | UncommunicativeMethodName: 5 | reject: 6 | - !ruby/regexp /^[a-z]$/ 7 | - !ruby/regexp /[0-9]$/ 8 | UncommunicativeParameterName: 9 | reject: 10 | - !ruby/regexp /^.$/ 11 | - !ruby/regexp /[0-9]$/ 12 | - !ruby/regexp /^_/ 13 | UncommunicativeVariableName: 14 | reject: 15 | - !ruby/regexp /^.$/ 16 | - !ruby/regexp /[0-9]$/ 17 | UtilityFunction: 18 | enabled: false 19 | LongParameterList: 20 | enabled: false 21 | DuplicateMethodCall: 22 | max_calls: 2 23 | IrresponsibleModule: 24 | enabled: false 25 | NestedIterators: 26 | max_allowed_nesting: 2 27 | PrimaDonnaMethod: 28 | enabled: false 29 | UnusedParameters: 30 | enabled: false 31 | FeatureEnvy: 32 | enabled: false 33 | ControlParameter: 34 | enabled: false 35 | UnusedPrivateMethod: 36 | enabled: false 37 | InstanceVariableAssumption: 38 | exclude: 39 | - !ruby/regexp /Controller$/ 40 | - !ruby/regexp /Mailer$/ 41 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": "airbnb", 4 | "plugins": [ 5 | "react" 6 | ], 7 | "rules": { 8 | "strict": 0, 9 | "new-cap": [2, {"capIsNewExceptions": ["FluxMixin", "StoreWatchMixin"]}], 10 | "no-underscore-dangle": ["warn", { "allowAfterThis": true }], 11 | "react/no-unused-prop-types": [1, { "skipShapeProps": true }] 12 | }, 13 | "globals": { 14 | "$": false, 15 | "Event": false, 16 | "FB": false, 17 | "Fluxxor": false, 18 | "HTMLCanvasElement": false, 19 | "React": false, 20 | "ReactDOM": false, 21 | "SortableMixin": false, 22 | "analytics": false, 23 | "classNames": false, 24 | "document": false, 25 | "localStorage": false, 26 | "moment": false, 27 | "navigator": false, 28 | "window": false 29 | }, 30 | "settings": { 31 | "import/resolver": { 32 | "node": { 33 | "paths": [ 34 | "./app/assets/javascripts" 35 | ] 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | TargetRubyVersion: 2.5 3 | TargetRailsVersion: 5.0 4 | Exclude: 5 | - 'bin/**/*' 6 | - 'db/**/*' 7 | - 'config/**/*' 8 | - 'script/**/*' 9 | - 'vendor/**/*' 10 | 11 | Layout/AlignParameters: 12 | EnforcedStyle: with_fixed_indentation 13 | 14 | Layout/CaseIndentation: 15 | EnforcedStyle: end 16 | 17 | Style/AsciiComments: 18 | Enabled: false 19 | 20 | Layout/IndentHash: 21 | Enabled: false 22 | 23 | Style/CollectionMethods: 24 | Enabled: true 25 | PreferredMethods: 26 | inject: 'inject' 27 | 28 | Style/Documentation: 29 | Enabled: false 30 | 31 | Style/BlockDelimiters: 32 | Exclude: 33 | - spec/**/*_spec.rb 34 | 35 | Style/BracesAroundHashParameters: 36 | Exclude: 37 | - spec/**/*_spec.rb 38 | 39 | Style/FormatString: 40 | Enabled: false 41 | 42 | Layout/MultilineMethodCallIndentation: 43 | EnforcedStyle: indented 44 | 45 | Layout/MultilineOperationIndentation: 46 | EnforcedStyle: indented 47 | 48 | Style/RedundantSelf: 49 | Enabled: false 50 | 51 | Layout/AlignHash: 52 | Enabled: true 53 | EnforcedLastArgumentHashStyle: always_ignore 54 | 55 | Style/TrivialAccessors: 56 | AllowPredicates: true 57 | 58 | #################### Metrics ############################### 59 | 60 | Metrics/AbcSize: 61 | Max: 20 62 | 63 | Metrics/ClassLength: 64 | Max: 100 65 | 66 | Metrics/ModuleLength: 67 | Max: 100 68 | 69 | Metrics/MethodLength: 70 | Max: 15 71 | 72 | #################### Lint ################################## 73 | 74 | Lint/AssignmentInCondition: 75 | AllowSafeAssignment: true 76 | 77 | Lint/Debugger: 78 | Enabled: true 79 | 80 | Layout/EndAlignment: 81 | EnforcedStyleAlignWith: variable 82 | 83 | #################### Performance ########################### 84 | 85 | Performance/Casecmp: 86 | Enabled: true 87 | 88 | Performance/CaseWhenSplat: 89 | Enabled: true 90 | 91 | Performance/DoubleStartEndWith: 92 | IncludeActiveSupportAliases: true 93 | 94 | Performance/EndWith: 95 | Enabled: true 96 | 97 | Performance/FixedSize: 98 | Enabled: true 99 | 100 | Performance/FlatMap: 101 | Enabled: true 102 | 103 | Performance/LstripRstrip: 104 | Enabled: true 105 | 106 | Performance/RangeInclude: 107 | Enabled: true 108 | 109 | Performance/RedundantBlockCall: 110 | Enabled: true 111 | 112 | Performance/RedundantMatch: 113 | Enabled: true 114 | 115 | Performance/RedundantMerge: 116 | Enabled: true 117 | 118 | Performance/RedundantSortBy: 119 | Enabled: true 120 | 121 | Performance/RegexpMatch: 122 | Enabled: true 123 | 124 | Performance/ReverseEach: 125 | Enabled: true 126 | 127 | Performance/Sample: 128 | Enabled: true 129 | 130 | Performance/Size: 131 | Enabled: true 132 | 133 | Performance/CompareWithBlock: 134 | Enabled: true 135 | 136 | Performance/StartWith: 137 | Enabled: true 138 | 139 | Performance/StringReplacement: 140 | Enabled: true 141 | 142 | Performance/TimesMap: 143 | Enabled: true 144 | 145 | #################### Bundler ############################### 146 | 147 | Rails: 148 | Enabled: true 149 | 150 | Rails/ActionFilter: 151 | Enabled: true 152 | 153 | Rails/ApplicationJob: 154 | Enabled: true 155 | 156 | Rails/ApplicationRecord: 157 | Enabled: true 158 | 159 | Rails/ActiveSupportAliases: 160 | Enabled: true 161 | 162 | Rails/Blank: 163 | Enabled: true 164 | 165 | Rails/Date: 166 | Enabled: true 167 | 168 | Rails/Delegate: 169 | Enabled: true 170 | 171 | Rails/DelegateAllowBlank: 172 | Enabled: true 173 | 174 | Rails/DynamicFindBy: 175 | Enabled: true 176 | 177 | Rails/EnumUniqueness: 178 | Enabled: true 179 | 180 | Rails/Exit: 181 | Enabled: true 182 | 183 | Rails/FilePath: 184 | Enabled: true 185 | 186 | Rails/FindBy: 187 | Enabled: true 188 | 189 | Rails/FindEach: 190 | Enabled: true 191 | 192 | Rails/HasAndBelongsToMany: 193 | Enabled: true 194 | 195 | Rails/HasManyOrHasOneDependent: 196 | Enabled: true 197 | 198 | Rails/HttpPositionalArguments: 199 | Enabled: true 200 | 201 | Rails/NotNullColumn: 202 | Enabled: true 203 | 204 | Rails/Output: 205 | Enabled: true 206 | 207 | Rails/OutputSafety: 208 | Enabled: true 209 | 210 | Rails/PluralizationGrammar: 211 | Enabled: true 212 | 213 | Rails/Present: 214 | Enabled: true 215 | 216 | Rails/ReadWriteAttribute: 217 | Enabled: true 218 | 219 | Rails/RelativeDateConstant: 220 | Enabled: true 221 | 222 | Rails/RequestReferer: 223 | Enabled: true 224 | 225 | Rails/ReversibleMigration: 226 | Enabled: true 227 | 228 | Rails/SafeNavigation: 229 | Enabled: true 230 | 231 | Rails/ScopeArgs: 232 | Enabled: true 233 | 234 | Rails/TimeZone: 235 | Enabled: true 236 | 237 | Rails/UniqBeforePluck: 238 | Enabled: true 239 | 240 | Rails/SkipsModelValidations: 241 | Enabled: true 242 | 243 | Rails/Validation: 244 | Enabled: true 245 | 246 | #################### Security ############################## 247 | 248 | Security/Eval: 249 | Enabled: true 250 | 251 | Security/JSONLoad: 252 | Enabled: true 253 | 254 | Security/MarshalLoad: 255 | Enabled: true 256 | 257 | Security/YAMLLoad: 258 | Enabled: true 259 | 260 | #################### Bundler ############################### 261 | 262 | Bundler/DuplicatedGem: 263 | Description: 'Checks for duplicate gem entries in Gemfile.' 264 | Enabled: true 265 | Include: 266 | - '**/Gemfile' 267 | - '**/gems.rb' 268 | 269 | Bundler/OrderedGems: 270 | Description: >- 271 | Gems within groups in the Gemfile should be alphabetically sorted. 272 | Enabled: true 273 | Include: 274 | - '**/Gemfile' 275 | - '**/gems.rb' 276 | -------------------------------------------------------------------------------- /.scss-lint.yml: -------------------------------------------------------------------------------- 1 | # Default application configuration that all configurations inherit from. 2 | 3 | scss_files: "**/*.scss" 4 | plugin_directories: ['.scss-linters'] 5 | exclude: 6 | - "vendor/assets/stylesheets/**" 7 | - "vendor/assets/bower_components/**" 8 | - "node_modules/**" 9 | 10 | # List of gem names to load custom linters from (make sure they are already 11 | # installed) 12 | plugin_gems: [] 13 | 14 | linters: 15 | BangFormat: 16 | enabled: true 17 | space_before_bang: true 18 | space_after_bang: false 19 | 20 | BemDepth: 21 | enabled: false 22 | max_elements: 1 23 | 24 | BorderZero: 25 | enabled: true 26 | convention: zero # or `none` 27 | 28 | ChainedClasses: 29 | enabled: false 30 | 31 | ColorKeyword: 32 | enabled: true 33 | 34 | ColorVariable: 35 | enabled: true 36 | 37 | Comment: 38 | enabled: true 39 | style: silent 40 | 41 | DebugStatement: 42 | enabled: true 43 | 44 | DeclarationOrder: 45 | enabled: true 46 | 47 | DisableLinterReason: 48 | enabled: false 49 | 50 | DuplicateProperty: 51 | enabled: true 52 | 53 | ElsePlacement: 54 | enabled: true 55 | style: same_line # or 'new_line' 56 | 57 | EmptyLineBetweenBlocks: 58 | enabled: true 59 | ignore_single_line_blocks: true 60 | 61 | EmptyRule: 62 | enabled: true 63 | 64 | ExtendDirective: 65 | enabled: false 66 | 67 | FinalNewline: 68 | enabled: true 69 | present: true 70 | 71 | HexLength: 72 | enabled: false 73 | style: short # or 'long' 74 | 75 | HexNotation: 76 | enabled: true 77 | style: lowercase # or 'uppercase' 78 | 79 | HexValidation: 80 | enabled: true 81 | 82 | IdSelector: 83 | enabled: true 84 | 85 | ImportantRule: 86 | enabled: true 87 | 88 | ImportPath: 89 | enabled: true 90 | leading_underscore: false 91 | filename_extension: false 92 | 93 | Indentation: 94 | enabled: true 95 | allow_non_nested_indentation: false 96 | character: space # or 'tab' 97 | width: 2 98 | 99 | LeadingZero: 100 | enabled: true 101 | style: exclude_zero # or 'include_zero' 102 | 103 | MergeableSelector: 104 | enabled: true 105 | force_nesting: true 106 | 107 | NameFormat: 108 | enabled: true 109 | allow_leading_underscore: true 110 | convention: hyphenated_lowercase # or 'camel_case', or 'snake_case', or a regex pattern 111 | 112 | NestingDepth: 113 | enabled: true 114 | max_depth: 4 115 | ignore_parent_selectors: false 116 | 117 | PlaceholderInExtend: 118 | enabled: false 119 | 120 | PropertyCount: 121 | enabled: true 122 | include_nested: false 123 | max_properties: 15 124 | 125 | PropertySortOrder: 126 | enabled: true 127 | ignore_unspecified: false 128 | min_properties: 2 129 | separate_groups: false 130 | 131 | PropertySpelling: 132 | enabled: true 133 | extra_properties: [] 134 | disabled_properties: [] 135 | 136 | PropertyUnits: 137 | enabled: true 138 | global: [ 139 | 'ch', 'em', 'ex', 'rem', # Font-relative lengths 140 | 'cm', 'in', 'mm', 'pc', 'pt', 'px', 'q', # Absolute lengths 141 | 'vh', 'vw', 'vmin', 'vmax', # Viewport-percentage lengths 142 | 'deg', 'grad', 'rad', 'turn', # Angle 143 | 'ms', 's', # Duration 144 | 'Hz', 'kHz', # Frequency 145 | 'dpi', 'dpcm', 'dppx', # Resolution 146 | '%'] # Other 147 | properties: {} 148 | 149 | PseudoElement: 150 | enabled: true 151 | 152 | QualifyingElement: 153 | enabled: true 154 | allow_element_with_attribute: false 155 | allow_element_with_class: false 156 | allow_element_with_id: false 157 | 158 | SelectorDepth: 159 | enabled: true 160 | max_depth: 4 161 | 162 | SelectorFormat: 163 | enabled: true 164 | convention: hyphenated_lowercase # or 'strict_BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern 165 | 166 | Shorthand: 167 | enabled: true 168 | allowed_shorthands: [1, 2, 3, 4] 169 | 170 | SingleLinePerProperty: 171 | enabled: true 172 | allow_single_line_rule_sets: true 173 | 174 | SingleLinePerSelector: 175 | enabled: true 176 | 177 | SpaceAfterComma: 178 | enabled: true 179 | style: one_space # or 'no_space', or 'at_least_one_space' 180 | 181 | SpaceAfterPropertyColon: 182 | enabled: true 183 | style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned' 184 | 185 | SpaceAfterPropertyName: 186 | enabled: true 187 | 188 | SpaceAfterVariableName: 189 | enabled: true 190 | 191 | SpaceAroundOperator: 192 | enabled: true 193 | style: one_space # or 'at_least_one_space', or 'no_space' 194 | 195 | SpaceBeforeBrace: 196 | enabled: true 197 | style: space # or 'new_line' 198 | allow_single_line_padding: false 199 | 200 | SpaceBetweenParens: 201 | enabled: true 202 | spaces: 0 203 | 204 | StringQuotes: 205 | enabled: true 206 | style: single_quotes # or double_quotes 207 | 208 | TrailingSemicolon: 209 | enabled: true 210 | 211 | TrailingWhitespace: 212 | enabled: true 213 | 214 | TrailingZero: 215 | enabled: false 216 | 217 | TransitionAll: 218 | enabled: false 219 | 220 | UnnecessaryMantissa: 221 | enabled: true 222 | 223 | UnnecessaryParentReference: 224 | enabled: true 225 | 226 | UrlFormat: 227 | enabled: true 228 | 229 | UrlQuotes: 230 | enabled: true 231 | 232 | VariableForProperty: 233 | enabled: false 234 | properties: [] 235 | 236 | VendorPrefix: 237 | enabled: true 238 | identifier_list: base 239 | additional_identifiers: [] 240 | excluded_identifiers: [] 241 | 242 | ZeroUnit: 243 | enabled: true 244 | 245 | Compass::*: 246 | enabled: false 247 | --------------------------------------------------------------------------------