Skip to content

Commit

Permalink
Pivot to Helix linting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
auniverseaway committed Feb 7, 2024
2 parents 572bdd6 + 0141b75 commit b83c219
Show file tree
Hide file tree
Showing 7 changed files with 351 additions and 1,522 deletions.
59 changes: 13 additions & 46 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,52 +1,19 @@
/*
* Copyright 2019 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/

module.exports = {
root: true,
extends: 'airbnb-base',
env: { browser: true, mocha: true },
parser: '@babel/eslint-parser',
parserOptions: {
allowImportExportEverywhere: true,
sourceType: 'module',
requireConfigFile: false,
},
extends: '@adobe/helix',
rules: {
'no-param-reassign': [2, { props: false }],
'linebreak-style': ['error', 'unix'],
'import/extensions': ['error', { js: 'always' }],
'object-curly-newline': ['error', {
ObjectExpression: { multiline: true, minProperties: 6 },
ObjectPattern: { multiline: true, minProperties: 6 },
ImportDeclaration: { multiline: true, minProperties: 6 },
ExportDeclaration: { multiline: true, minProperties: 6 },
}],
'no-await-in-loop': 0,
'class-methods-use-this': 0,
'no-return-assign': ['error', 'except-parens'],
'no-unused-expressions': 0,
'chai-friendly/no-unused-expressions': 2,
'no-underscore-dangle': ['error', { allowAfterThis: true }],
'no-restricted-syntax': [
'error',
{
selector: 'ForInStatement',
message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
},
{
selector: 'LabeledStatement',
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
},
{
selector: 'WithStatement',
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
},
],
},
overrides: [
{
files: ['test/**/*.js'],
rules: { 'no-console': 'off' },
},
],
plugins: [
'chai-friendly',
],
};
Loading

0 comments on commit b83c219

Please sign in to comment.