mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
refactor(internal): Use named function expressions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export default function (property) {
|
||||
export default function getPropertyName (property) {
|
||||
if (property.type === 'Literal') {
|
||||
return property.value
|
||||
} else if (property.type === 'Identifier') {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default function (type) {
|
||||
export default function isFunction (type) {
|
||||
return (
|
||||
type === 'ArrowFunctionExpression' ||
|
||||
type === 'FunctionExpression'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import isMeteorProp from './isMeteorProp'
|
||||
|
||||
export default function (node, propName) {
|
||||
export default function isMeteorCall (node, propName) {
|
||||
return (
|
||||
node.type === 'CallExpression' &&
|
||||
node.callee.type === 'MemberExpression' &&
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default function (node, propName) {
|
||||
export default function isMeteorProp (node, propName) {
|
||||
return (
|
||||
node.type === 'MemberExpression' &&
|
||||
node.object.type === 'Identifier' && node.object.name === 'Meteor' &&
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import getPropertyName from './getPropertyName'
|
||||
|
||||
export default function (node, propName) {
|
||||
export default function isTemplateProp (node, propName) {
|
||||
return (
|
||||
node.type === 'MemberExpression' &&
|
||||
node.object.type === 'MemberExpression' &&
|
||||
|
||||
@@ -2,7 +2,7 @@ import {UNIVERSAL, CLIENT, SERVER} from '../environment'
|
||||
|
||||
const meteorEnvRegEx = /^eslint-meteor-env (client|server)\s?(,\s?(client|server))*$/
|
||||
|
||||
export default function (comments = []) {
|
||||
export default function getEnvFromComments (comments = []) {
|
||||
const envs = new Set()
|
||||
comments.forEach(comment => {
|
||||
const trimmedValue = comment
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import stripPathPrefix from './stripPathPrefix'
|
||||
const getRootPath = require('./getRootPath')
|
||||
|
||||
export default function (filename) {
|
||||
export default function getRelativePath (filename) {
|
||||
// '<input>' is ESLint's default filename when the real one is not known
|
||||
if (filename === '<input>') {
|
||||
return false
|
||||
|
||||
@@ -9,7 +9,7 @@ function hasFile (parent, filename) {
|
||||
// cache for root paths
|
||||
const rootPaths = []
|
||||
|
||||
export default function (filename) {
|
||||
export default function getRootPath (filename) {
|
||||
|
||||
// check whether the project root is already known or not
|
||||
let rootPath = find(rootPaths, function (currentPath) {
|
||||
|
||||
Reference in New Issue
Block a user