Skip to content

Commit

Permalink
Remove ESLint formatting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
diogoazevedos committed Nov 6, 2023
1 parent 6a1a808 commit 52201aa
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 210 deletions.
177 changes: 1 addition & 176 deletions configs/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = {
builtin: true,
es2021: true
},
plugins: ['@stylistic/js'],
rules: {
'array-callback-return': 'error',
'no-array-constructor': 'error',
Expand Down Expand Up @@ -313,180 +312,6 @@ module.exports = {
'logical-assignment-operators': ['error', 'never'],

// enable in the future (ES2022)
'prefer-object-has-own': 'off',

'@stylistic/js/no-confusing-arrow': 'error',
'@stylistic/js/no-extra-parens': 'error',
'@stylistic/js/no-extra-semi': 'error',
'@stylistic/js/no-floating-decimal': 'error',
'@stylistic/js/no-mixed-spaces-and-tabs': 'error',
'@stylistic/js/linebreak-style': ['error', 'unix'],
'@stylistic/js/no-multi-spaces': 'error',
'@stylistic/js/no-multiple-empty-lines': [
'error',
{
max: 1
}
],
'@stylistic/js/no-tabs': 'error',
'@stylistic/js/no-trailing-spaces': 'error',
'@stylistic/js/no-whitespace-before-property': 'error',
'@stylistic/js/no-mixed-operators': 'off',
'@stylistic/js/array-bracket-spacing': ['error', 'never'],
'@stylistic/js/array-bracket-newline': ['error', 'consistent'],
'@stylistic/js/array-element-newline': ['error', 'consistent'],
'@stylistic/js/arrow-parens': ['error', 'always'],
'@stylistic/js/arrow-spacing': [
'error',
{
before: true,
after: true
}
],
'@stylistic/js/block-spacing': 'off',
'@stylistic/js/brace-style': [
'error',
'1tbs',
{
allowSingleLine: false
}
],
'@stylistic/js/comma-dangle': ['error', 'never'],
'@stylistic/js/comma-spacing': [
'error',
{
before: false,
after: true
}
],
'@stylistic/js/comma-style': ['error', 'last'],
'@stylistic/js/computed-property-spacing': [
'error',
'never',
{
enforceForClassMembers: true
}
],
'@stylistic/js/generator-star-spacing': ['error', { before: false, after: true }],
'@stylistic/js/dot-location': ['error', 'property'],
'@stylistic/js/eol-last': 'error',
'@stylistic/js/indent': [
'error',
4,
{
SwitchCase: 1,
VariableDeclarator: 1,
MemberExpression: 1
}
],
'@stylistic/js/jsx-quotes': 'off',
'@stylistic/js/key-spacing': [
'error',
{
beforeColon: false,
afterColon: true
}
],
'@stylistic/js/lines-around-comment': 'off',
'@stylistic/js/multiline-ternary': 'off',
'@stylistic/js/max-statements-per-line': ['error', { max: 1 }],
'@stylistic/js/new-parens': 'error',
'@stylistic/js/newline-per-chained-call': 'off',
'@stylistic/js/object-curly-newline': 'off',
'@stylistic/js/object-curly-spacing': ['error', 'always'],
'@stylistic/js/object-property-newline': 'off',
'@stylistic/js/one-var-declaration-per-line': 'error',
'@stylistic/js/operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before' } }],
'@stylistic/js/padded-blocks': [
'error',
'never',
{
allowSingleLineBlocks: false
}
],
'@stylistic/js/quote-props': ['error', 'as-needed'],
'@stylistic/js/quotes': ['error', 'single', { avoidEscape: true }],
'@stylistic/js/rest-spread-spacing': ['error', 'never'],
'@stylistic/js/semi': ['error', 'always'],
'@stylistic/js/semi-spacing': [
'error',
{
before: false,
after: true
}
],
'@stylistic/js/keyword-spacing': [
'error',
{
before: true,
after: true
}
],
'@stylistic/js/space-before-blocks': ['error', 'always'],
'@stylistic/js/space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}
],
'@stylistic/js/space-in-parens': ['error', 'never'],
'@stylistic/js/space-infix-ops': 'error',
'@stylistic/js/space-unary-ops': 'error',
'@stylistic/js/spaced-comment': [
'error',
'always',
{
line: {
exceptions: ['-', '+', '*'],
markers: ['!', '/', '=>']
},
block: {
exceptions: ['-', '+', '*'],
markers: ['!', '*'],
balanced: true
}
}
],
'@stylistic/js/template-curly-spacing': 'error',
'@stylistic/js/wrap-iife': ['error', 'inside'],
'@stylistic/js/wrap-regex': 'off',
'@stylistic/js/yield-star-spacing': ['error', { before: false, after: true }],
'@stylistic/js/func-call-spacing': ['error', 'never'],
'@stylistic/js/nonblock-statement-body-position': 'off',
'@stylistic/js/template-tag-spacing': ['error', 'never'],
'@stylistic/js/padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: 'directive',
next: '*'
},
{
blankLine: 'any',
prev: 'directive',
next: 'directive'
}
],
'@stylistic/js/semi-style': ['error', 'last'],
'@stylistic/js/switch-colon-spacing': [
'error',
{
after: true,
before: false
}
],
'@stylistic/js/function-paren-newline': 'off',
'@stylistic/js/implicit-arrow-linebreak': 'off',
'@stylistic/js/lines-between-class-members': [
'error',
'always',
{
exceptAfterSingleLine: true
}
],
'@stylistic/js/function-call-argument-newline': ['error', 'consistent'],
'@stylistic/js/max-len': 'off'
'prefer-object-has-own': 'off'
}
};
17 changes: 0 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"homepage": "https://github.com/joyn/eslint-config",
"devDependencies": {
"@eslint/js": "8.53.0",
"@stylistic/eslint-plugin-js": "1.0.0",
"@typescript-eslint/eslint-plugin": "6.9.1",
"@typescript-eslint/parser": "6.9.1",
"ava": "5.3.1",
Expand All @@ -55,7 +54,6 @@
"typescript": "5.2.2"
},
"peerDependencies": {
"@stylistic/eslint-plugin-js": "^1.0.0",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"eslint": "^8.53.0",
Expand Down
16 changes: 1 addition & 15 deletions test/core.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,15 @@

const test = require('ava');
const eslintDefaults = require('@eslint/js').configs.all;
const stylisticPlugin = require('@stylistic/eslint-plugin-js');
const eslintReplacements = require('../node_modules/eslint/conf/replacements.json');
const coreConfig = require('../configs/core');
const { testCoreRulesConfigured, testPluginRulesConfigured, testContainsKnownPluginRules } = require('./macros');
const { testCoreRulesConfigured } = require('./macros');

test('all core rules are configured', testCoreRulesConfigured, {
rules: eslintDefaults.rules,
ruleConfigSet: coreConfig.rules
});

test('all eslint-plugin-stylistic rules are configured', testPluginRulesConfigured, {
ruleConfigSet: coreConfig.rules,
rules: stylisticPlugin.rules,
pluginName: '@stylistic/js'
});

test('does not contain removed core rules', (t) => {
const rules = Object.keys(eslintDefaults.rules);
const configuredRules = Object.keys(coreConfig.rules);
Expand All @@ -39,10 +32,3 @@ test('does not contain replaced core rules', (t) => {
t.false(configuredRules.includes(ruleName));
});
});

test('contains only known plugin rules', testContainsKnownPluginRules, {
ruleConfigSet: coreConfig.rules,
pluginRules: {
'@stylistic/js': stylisticPlugin.rules
}
});

0 comments on commit 52201aa

Please sign in to comment.