Skip to content

Commit

Permalink
chore: add @distributive eslint config
Browse files Browse the repository at this point in the history
In addition to adding the config, lint issues were addressed.
  • Loading branch information
bryan-hoang committed Aug 29, 2023
1 parent dec6493 commit e37a352
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 30 deletions.
37 changes: 23 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
"use strict";
/**
* @file .eslintrc.js - Configures ESLint for the plugin repo.
*
* @author Joash Mathew <[email protected]>
* @author Bryan Hoang <[email protected]>
* @date June 2023, Aug. 2023
*/
'use strict';

/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:n/recommended",
"plugin:eslint-plugin/tests",
"plugin:eslint-plugin/rules-recommended",
'eslint:recommended',
'plugin:n/recommended',
'plugin:eslint-plugin/tests',
'plugin:eslint-plugin/rules-recommended',
'@distributive',
'plugin:@distributive/recommended',
],
env: {
node: true,
},
overrides: [
{
files: ["tests/**/*.js"],
env: { mocha: true },
overrides: [ {
files: ['**/*.mjs'],
parserOptions: {
sourceType: 'module',
},
},
],
rules: {
"eslint-plugin/meta-property-ordering": "error",
"eslint-plugin/report-message-format": ["error", "^[A-Z].*\\.$"],
"eslint-plugin/require-meta-docs-description": [
"error",
{
'eslint-plugin/meta-property-ordering': 'error',
'eslint-plugin/report-message-format': ['error', '^[A-Z].*\\.$'],
'eslint-plugin/require-meta-docs-description': [
'error', {
pattern: '^(Enforce|Require|Disallow)',
},
],
Expand Down
20 changes: 12 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
/**
* @fileoverview Plugin containing Distributive style guide stuff
* @author Joash Mathew
* @file lib/index.js - Entrypoint for the plugin.
*
* @author Joash Mathew <[email protected]>
* @author Bryan Hoang <[email protected]>
* @date June 2023, Aug. 2023
*/
"use strict";

//------------------------------------------------------------------------------
'use strict';

// ------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
// ------------------------------------------------------------------------------

// ------------------------------------------------------------------------------
// Plugin Definition
//------------------------------------------------------------------------------
// ------------------------------------------------------------------------------

module.exports.meta = {
name: "eslint-plugin-distributive",
version: "1.0.0",
name: 'eslint-plugin-distributive',
version: '1.0.0',
}

// import all rules in lib/rules
Expand Down
140 changes: 137 additions & 3 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@
"test": "vitest",
"update:eslint-docs": "eslint-doc-generator"
},
"dependencies": {
"requireindex": "^1.2.0"
},
"devDependencies": {
"@distributive/eslint-config": "1.0.4",
"eslint": "^8.48.0",
"eslint-doc-generator": "^1.4.3",
"eslint-plugin-eslint-plugin": "^5.1.1",
"eslint-plugin-jsdoc": "46.5.0",
"eslint-plugin-n": "^16.0.2",
"npm-run-all": "^4.1.5",
"vitest": "^0.34.3"
Expand Down
9 changes: 7 additions & 2 deletions tests/lib/rules/brace-style.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
/**
* @fileoverview Enforce bracing styles in accordance to the Distributive style guide
* @author Joash Mathew
* @file brace-style.test.js - Tests the custom brace-style rule against
* valid & invalid test cases.
*
* @author Joash Mathew <[email protected]>
* @author Bryan Hoang <[email protected]>
* @date June 2023, Aug. 2023
*/

'use strict';

// ------------------------------------------------------------------------------
Expand Down
9 changes: 9 additions & 0 deletions vitest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @file vitest.config.mjs - Configures `vitest` for testing the project.
*
* See {@link https://vitest.dev/config/}.
*
* @author Bryan Hoang <[email protected]>
* @date Aug. 2023
*/

import { defineConfig } from 'vitest/config';

export default defineConfig({
Expand Down

0 comments on commit e37a352

Please sign in to comment.